home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / coldcap.lha / cold.s next >
Encoding:
Text File  |  1980-03-08  |  719 b   |  53 lines

  1.  
  2.     ;how to do a ColdCapture by Shagratt/LSD
  3.  
  4.     opt    o+,w-
  5.  
  6.     section reset,code
  7.  
  8.     include    system
  9.     include    exec/execbase.i
  10.  
  11. Go:    move.l    #1024,d0
  12.     move.l    #MEMF_CLEAR+MEMF_FAST,d1
  13.     CALLEXEC    AllocMem
  14.     beq    .err
  15.     move.l    d0,Mem
  16.     
  17.     move.l    Mem,a0
  18.     lea    resetcode,a1
  19.     move.w    #256,d0
  20. .copy    move.l    (a1)+,(a0)+
  21.     dbf    d0,.copy
  22.  
  23.     move.l    Mem,a0
  24.     move.l    4,a6
  25.     move.l    a0,CoolCapture(a6)
  26.  
  27.     moveq.l    #0,d1
  28.     lea    34(a6),a0
  29.     move.w    #$16,d0
  30. .calc1    add.w    (a0)+,d1
  31.     dbf    d0,.calc1
  32.     not.w    d1
  33.     move.w    d1,82(a6)
  34.     
  35.     lea    resetnow,a5
  36.     CALLEXEC    Supervisor
  37. .err    rts
  38.  
  39. resetnow:    lea    2,a0
  40.     reset
  41.     jmp    (a0)
  42.     
  43. resetcode:    movem.l    d0-d7/a0-a6,-(a7)
  44.  
  45.     move.w    #$8000,d0
  46. .again    move.w    $dff006,$dff180
  47.     dbf    d0,.again
  48.             
  49. .nomore    movem.l    (a7)+,d0-d7/a0-a6
  50.     rts
  51.  
  52. Mem:    dc.l    0
  53.