home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI05.ARJ / ictari.05 / ASSEMBLY / DOCCY / DOCCY.S next >
Text File  |  1993-07-07  |  11KB  |  268 lines

  1. ; this is just a pre-release version of a doc displayer.
  2. ; please don't complain about the messy code or speed of it as it is not
  3. ; finished!!!!!!  I labeled it so you can follow it better.
  4. ; the text that was used originally was deemed unsuitable for public
  5. ; viewing so you get lots of boring stars instead.
  6.  
  7. * The problem is that it will not work properly when it is assembled like
  8. * a normal prg and run from the desktop, assemble it to memory and run it
  9. * in devpac and it works perfectly, now assemble it to disk and re-boot
  10. * the machine (med res), run the assembled prg... and watch it screw up
  11. * Why does it only work from devpac???   I found that resolution changes
  12. * (to med res) in the code make it screw up also, what does devpac do that
  13. * the desktop doesn't???
  14.  
  15. *       PLEASE HELP ME  its driving me up the wall!!!!!!    <T.S.C.>
  16.  
  17. ; Coded in Devpac v2.04 (old)  -  Tabs set to 10.
  18.  
  19. printat    macro    \1,\2,\3,\4
  20.     move.b    #\1,pr_col+2    the ink
  21.     move.b    #\2,d1
  22.     add.b    #32,d1    
  23.     move.b    d1,pr_loc+2    the row
  24.     move.b    #\3,d2
  25.     add.b    #32,d2
  26.     move.b    d2,pr_loc+3    the column    
  27.     move.l    \4,a3
  28.     move.l    a3,-(sp)
  29.     move.l    #pr_col,a3
  30.     move.l     a3,-(sp)
  31.     move.w    #9,-(sp)
  32.     trap    #1
  33.     addq.l    #6,sp
  34.     move.l    (sp)+,a3    retrieve the address of message
  35.     move.l     a3,-(sp)
  36.     move.w    #9,-(sp)
  37.     trap    #1
  38.     addq.l    #6,sp
  39.     endm
  40.  
  41. pages    equ    4        amount of pages
  42.  
  43.     pea    0.w        supervisor mode
  44.     move.w    #$20,-(sp)
  45.     trap    #1
  46.     addq.l    #6,sp
  47.     move.l    d0,oldsp
  48.  
  49.     bclr    #0,$484.w        no key click
  50.     bclr    #1,$484.w        no key repeat
  51.  
  52.     move.b    #$12,$fffffc02.w    bye bye Mr mouse
  53. * this is the one!
  54.     bsr    wrap        set VT52 to wrap mode!
  55. ;    bsr    home        cursor home
  56.  
  57.     move.l    #1,pagecount    init stuff
  58.     bsr    clear        
  59.     lea    text,a0        a0 points to text
  60.     lea    buffer,a1        a1 points to buffer
  61.     bsr    first_p        display the first page
  62.  
  63. mainloop    cmp.b    #$48,$fffffc02.w    check for cursor up
  64.     bne.s    chk_down        no so next key check
  65.     bra.s    higher    
  66. chk_down    cmp.b    #$50,$fffffc02.w    cursor down
  67.     bne.s    chk_quit        
  68.     bra    lower
  69. chk_quit    cmp.b    #$01,$fffffc02.w    escape key
  70.     bne.s    mainloop    
  71.     bra    quit
  72.  
  73. higher    cmp.l    #1,pagecount    are we at the first page?
  74.     beq.s    mainloop        yes so cant go up anymore
  75.     subq.l    #1,pagecount   not on first page, sub 1 from page count
  76.     bsr    vsync
  77. ;    bsr    home        home position
  78.     bsr    clear        cls
  79.     lea    buffer,a1        get the buffer
  80.     lea     -3200(a0),a0        up a page so sub 3200 bytes (20*80)
  81. ; i.e.  80 bytes per line and 20 lines
  82.     moveq.l    #20-1,d0        loop 20 times
  83. loop1
  84.     rept    20        handy command, saves typing a lot!
  85.     move.l    (a0)+,(a1)+    copy text to buffer
  86.     endr
  87.     dbf    d0,loop1        branch until false
  88.     clr.b    null        null terminate the text
  89.     printat    15,2,0,#buffer
  90. ;    bsr    print        print it
  91.     bra    mainloop        go back to main loop
  92.  
  93.  
  94. lower    cmp.l    #pages,pagecount    are we on the last page?
  95.     beq    mainloop        yes so cant go down no more
  96.     addq.l    #1,pagecount    if going down add 1 to page count
  97.     bsr    vsync
  98. ;    bsr    home        home position
  99.     bsr    clear        cls
  100.  
  101. ;    lea    buffer,a1        down 1 line (ingnore for now)
  102. ;    add    #80,a0        
  103. ;    sub    #1840,a0        
  104.  
  105.     lea    buffer,a1        get buffer
  106.     moveq.l    #20-1,d0        loop 20 times
  107. loop2    
  108.     rept    20
  109.     move.l    (a0)+,(a1)+    copy text to buffer
  110.     endr
  111.     dbf    d0,loop2
  112.     clr.b    null        null terminate the text
  113.     printat    15,2,0,#buffer
  114. ;    bsr.s    print        print it
  115.     bra    mainloop        back to main loop
  116.  
  117. first_p    lea    buffer,a1        come on you must get this 
  118.     moveq.l    #20-1,d0        by now?
  119. lop2    
  120.     rept    20
  121.     move.l    (a0)+,(a1)+
  122.     endr
  123.     dbf    d0,lop2
  124.     clr.b    null
  125.     printat    15,2,0,#buffer
  126. ;    bsr.s    print
  127.     bra    mainloop    
  128.  
  129. clear    pea    robby        clear screen rout
  130.     move.w    #9,-(sp)
  131.     trap    #1
  132.     addq.l    #6,sp
  133.     rts
  134.  
  135. print    move.l    #buffer,-(sp)
  136.     move.w    #9,-(sp)
  137.     trap    #1
  138.     addq.l    #6,sp
  139.     rts
  140.  
  141. wrap    move.l    #wrapcode,-(sp)
  142.     move.w    #9,-(sp)
  143.     trap    #1
  144.     addq.l    #6,sp
  145.     rts
  146.  
  147.  
  148. home    pea    homey        home position
  149.     move.w    #9,-(sp)
  150.     trap    #1
  151.     addq.l    #6,sp
  152.     rts
  153.  
  154. quit    move.b    #8,$fffffc02.w    mouse back
  155.     bset    #0,$484.w        key repeat and click back on
  156.     bset    #1,$484.w
  157.  
  158.     pea    oldsp        user mode
  159.     move.w    #$20,-(sp)
  160.     trap    #1
  161.      addq.l    #6,sp
  162.  
  163.     pea    0.w        exit
  164.     trap    #1
  165.  
  166. vsync    move.l    $466.w,d1        wait for next vbl
  167. vwait    cmp.l    $466.w,d1
  168.     beq.s    vwait
  169.     rts
  170.  
  171.     data
  172. oldsp    dc.l    0
  173. pr_col    dc.b 27,"b",15        no zero here! ,0
  174. pr_loc    dc.b 27,"Y",32,32,0,0    dynamic variables, liable to change!
  175. wrapcode    dc.b    27,"v",0
  176.  
  177.     even
  178.  
  179. robby    dc.b    $1b,$45,0
  180. homey    dc.b     27,"H",0
  181.  
  182.     section bss
  183.  
  184. pagecount    ds.l    1
  185. buffer    ds.l    400
  186. null    ds.b    0
  187.  
  188.     section data
  189.  
  190.         *12345678901234567890123456789012345678901234567890123456789012345678901234567890*
  191.     
  192. text    dc.b    "   22 22 22  ******************************************************  22 22 22   "
  193.     dc.b    "  333 22 333  ****************************************************  333 22 333  "
  194.     dc.b    " 4444 22 4444  **************************************************  4444 22 4444 "
  195.     dc.b    "0******************************************************************************!"
  196.     dc.b    "********************************************************************************"
  197.     dc.b    "********************************************************************************"
  198.     dc.b    "********************************************************************************"
  199.     dc.b    "********************************************************************************"
  200.     dc.b    "********************************************************************************"
  201.     dc.b    "********************************************************************************"
  202.     dc.b    "********************************************************************************"
  203.     dc.b    "********************************************************************************"
  204.     dc.b    "********************************************************************************"
  205.     dc.b    "********************************************************************************"
  206.     dc.b    "********************************************************************************"
  207.     dc.b    "********************************************************************************"
  208.     dc.b    "********************************************************************************"
  209.     dc.b    "********************************************************************************"
  210.     dc.b    "********************************************************************************"
  211.     dc.b    "********************************************************************************"
  212.     dc.b    "********************************************************************************"
  213.     dc.b    "********************************************************************************"
  214.     dc.b    "********************************************************************************"
  215.     dc.b    "********************************************************************************"
  216.     dc.b    "********************************************************************************"
  217.     dc.b    "********************************************************************************"
  218.     dc.b    "********************************************************************************"
  219.     dc.b    "********************************************************************************"
  220.     dc.b    "********************************************************************************"
  221.     dc.b    "********************************************************************************"
  222.     dc.b    "********************************************************************************"
  223.     dc.b    "********************************************************************************"
  224.     dc.b    "********************************************************************************"
  225.     dc.b    "********************************************************************************"
  226.     dc.b    "********************************************************************************"
  227.     dc.b    "********************************************************************************"
  228.     dc.b    "********************************************************************************"
  229.     dc.b    "********************************************************************************"
  230.     dc.b    "********************************************************************************"
  231.     dc.b    "********************************************************************************"
  232.     dc.b    "********************************************************************************"
  233.     dc.b    "********************************************************************************"
  234.     dc.b    "********************************************************************************"
  235.     dc.b    "********************************************************************************"
  236.     dc.b    "********************************************************************************"
  237.     dc.b    "********************************************************************************"
  238.     dc.b    "********************************************************************************"
  239.     dc.b    "********************************************************************************"
  240.     dc.b    "********************************************************************************"
  241.     dc.b    "********************************************************************************"
  242.     dc.b    "********************************************************************************"
  243.     dc.b    "********************************************************************************"
  244.     dc.b    "********************************************************************************"
  245.     dc.b    "********************************************************************************"
  246.     dc.b    "********************************************************************************"
  247.     dc.b    "********************************************************************************"
  248.     dc.b    "********************************************************************************"
  249.     dc.b    "********************************************************************************"
  250.     dc.b    "********************************************************************************"
  251.     dc.b    "********************************************************************************"
  252.     dc.b    "t0hough!!!!!!!!..........                                                       "
  253.     dc.b    "q1                                                                              "
  254.     dc.b    "e2                                                                              "
  255.     dc.b    "g3                                                                              "
  256.     dc.b    "94                                                                              "
  257.     dc.b    "85                                                                              "
  258.     dc.b    "76                                                                              "
  259.     dc.b    "67                                                                              "
  260.     dc.b    "58                                                                              "
  261.     dc.b    "49                                                                              "
  262.     dc.b    "30                                                                              "
  263.     dc.b    "2s                                                                              "
  264.     dc.b    "1a                                                                              "
  265.     dc.b    "033000000                                                             ",0
  266.     
  267.  
  268.