home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / program / lynxlib / clock.s < prev    next >
Encoding:
Text File  |  1993-10-23  |  1.0 KB  |  49 lines

  1. ; This source file is part of the LynxLib miscellaneous library by
  2. ; Robert Fischer, and is Copyright 1990 by Robert Fischer.  It costs no
  3. ; money, and you may not make money off of it, but you may redistribute
  4. ; it.  It comes with ABSOLUTELY NO WARRANTY.  See the file LYNXLIB.DOC
  5. ; for more details.
  6. ; To contact the author:
  7. ;     Robert Fischer \\80 Killdeer Rd \\Hamden, CT   06517   USA
  8. ;     (203) 288-9599     fischer-robert@cs.yale.edu
  9.  
  10. ; Stuff having to do with clocking
  11. ; By Robert Fischer, January 17, 1988
  12. .include "atari.s"
  13.  
  14.     .globl _read_clock
  15.     .globl _wait
  16.  
  17. _read_clock:
  18.     clr.l    -(sp)        ; Supervisor Mode
  19.     move.w    #$20,-(sp)
  20.     trap    #GEMDOS
  21.     addq    #6,sp
  22.  
  23.     move.l    _hz_200, -(sp)
  24.  
  25.     move.l    d0,-(sp)        ; User mode
  26.     move.w    #$20,-(sp)
  27.     trap    #GEMDOS
  28.     addq    #6,sp
  29.  
  30.     move.l    (sp)+, d0
  31.     rts
  32.  
  33.  
  34. _wait: .cargs .delay.w
  35.     move.l    d4, -(sp)        ; Save Registers
  36.  
  37.     bsr        _read_clock
  38.     move.w    .delay+4(sp), d4
  39.     ext.l    d4
  40.     add.l    d0, d4
  41.  
  42. waitloop:
  43.     bsr        _read_clock
  44.     cmp.l    d0, d4
  45.     bpl        waitloop
  46.  
  47.     move.l    (sp)+, d4
  48.     rts
  49.