home *** CD-ROM | disk | FTP | other *** search
/ Fujiology Archive / fujiology_archive_v1_0.iso / !MAGS / !BONUS / COVERDSK / STFORMAT / STF32.ZIP / STF32.MSA / ASSEMBLY_GDOS.S next >
Text File  |  1992-01-05  |  4KB  |  172 lines

  1. * GDOS.S
  2. * This program outputs a rounded rectangle to a printer.
  3.  
  4. *HEADER
  5.        move.l  a7,a5
  6.        move.l  #ustk,a7
  7.        move.l  4(a5),a5
  8.        move.l  12(a5),d0
  9.        add.l   20(a5),d0
  10.        add.l   28(a5),d0
  11.        add.l   #$100,d0
  12.        move.l  d0,-(sp)
  13.        move.l  a5,-(sp)
  14.        clr.w   -(sp)
  15.        move    #$4a,-(sp)
  16.        trap    #1
  17.        add.l   #12,sp
  18.  
  19. * appl_intit()
  20.        move.l  #appl_init,aespb
  21.        jsr     aes            ; call AES 
  22.  
  23. * get current screen resolution
  24.        move.w  #4,-(sp)
  25.        trap    #14
  26.        addq.l  #2,sp
  27.        move.w  d0,res
  28.  
  29. * is gdos present
  30.        moveq   #-2,d0
  31.        trap    #2
  32.        addq    #2,d0
  33.        beq     quit
  34.        move    res,d0
  35.        add     #2,d0
  36.        move    d0,intin
  37. * if no GDOS should not continue
  38.        
  39. * graf_handle
  40.        move    #77,contrl
  41.        move    #0,contrl+2
  42.        move    #5,contrl+4
  43.        move    #0,contrl+6
  44.        move    #0,contrl+8
  45.        jsr     aes
  46.        move    intout,gr_handle
  47.  
  48. * v_opnvwk
  49. * start by opening a virtual  workstation
  50.        move    #100,contrl
  51.        move    #0,contrl+2
  52.        move    #11,contrl+6
  53.        move    gr_handle,contrl+12
  54.        move    #1,intin+2      
  55.        move    #1,intin+4      
  56.        move    #1,intin+6      
  57.        move    #1,intin+8
  58.        move    #1,intin+10     
  59.        move    #1,intin+12     
  60.        move    #1,intin+14     
  61.        move    #1,intin+16     
  62.        move    #1,intin+18     
  63.        move    #2,intin+20     
  64.        jsr     vdi
  65.        move.w  contrl+12,ws_handle
  66.  
  67. * v_opnwk
  68. * open printer
  69.        move    #1,contrl
  70.        move    #0,contrl+2
  71.        move    #11,contrl+6    
  72.        move    ws_handle,contrl+12   
  73.        move    #21,intin               ; fx80 driver
  74.        move    #1,intin+2      
  75.        move    #1,intin+4      
  76.        move    #1,intin+6
  77.        move    #1,intout+8     
  78.        move    #1,intin+10     
  79.        move    #1,intin+12     
  80.        move    #1,intin+14     
  81.        move    #1,intin+16     
  82.        move    #1,intin+18     
  83.        move    #2,intin+20     
  84.        jsr     vdi
  85.        move.w  contrl+12,p_handle      ; printer handle
  86.  
  87. *to see if there is there a driver, test d0, if zero no driver
  88.  
  89. * output rounded rectangle
  90.        move    #11,contrl
  91.        move    #2,contrl+2
  92.        move    #0,contrl+6     
  93.        move    p_handle,contrl+12
  94.        move    #8,contrl+10    ; function 8
  95.        move    #100,ptsin      ; x coord printer
  96.        move    #50,ptsin+2     ; y coord printer
  97.        move    #100+60,ptsin+4 ; x coord right edge
  98.        move    #50+40,ptsin+6  ; y coord bottom edge
  99.        jsr     vdi     
  100.  
  101.  
  102. * update workstation- actually print
  103. * v_updwk
  104.        move    #4,contrl
  105.        move.w  #0,contrl+2
  106.        move.w  #0,contrl+6
  107.        move.w  p_handle,contrl+12      
  108.        jsr     vdi
  109.  
  110. * v_clswk
  111. *  close the workstation (printer)
  112.        move    #2,contrl
  113.        clr.w   contrl+2
  114.        clr.w   contrl+6
  115.        move.w  p_handle,contrl+12              
  116.        jsr     vdi
  117.  
  118. * v_clsvwk
  119. *  close the virtual workstation
  120.        move    #101,contrl
  121.        clr.w   contrl+2
  122.        clr.w   contrl+6
  123.        move.w  ws_handle,contrl+12             
  124.        jsr     vdi
  125.  
  126. quit:
  127.  
  128. * appl_exit()
  129.        move.l    #appl_exit,aespb
  130.        bsr       aes            ; call AES 
  131.  
  132.        move    #1,-(sp)
  133.        move    #$4c,-(sp)
  134.        trap    #1
  135.  
  136. aes:
  137.        movem.l d0-d7/a0-a6,-(sp)
  138.        move.l  #aespb,d1
  139.        move.w  #$c8,d0
  140.        trap    #2
  141.        movem.l (sp)+,d0-d7/a0-a6
  142.        rts
  143. vdi:
  144.        movem.l d0-d7/a0-a6,-(sp)
  145.        move.l  #vdipb,d1
  146.        moveq.l #$73,d0
  147.        trap    #2
  148.        movem.l (sp)+,d0-d7/a0-a6
  149.        rts
  150.        
  151.        ds.l    100
  152. ustk:  ds.l    1
  153.  
  154. contrl: ds.w    128
  155. intin:  ds.w    128
  156. intout: ds.w    128
  157. global: ds.w    128
  158. addrin: ds.w    128
  159. addrout:        ds.w    128
  160. ptsin:  ds.w    128
  161. ptsout: ds.w    128
  162.  
  163. aespb: dc.l    contrl,global,intin,intout,addrin,addrout
  164. vdipb: dc.l    contrl,intin,ptsin,intout,ptsout
  165. p_handle:      ds.w    1
  166. gr_handle:     ds.w    1
  167. ws_handle:     ds.w    1
  168. res:           ds.w    1
  169. appl_init:     dc.w     10,0,1,0,0
  170. appl_exit:     dc.w     19,0,1,0,0
  171.  
  172.