home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d01xx / d0128.lha / PrtDriver / pwait.asm < prev    next >
Assembly Source File  |  1988-01-02  |  758b  |  48 lines

  1. *
  2. * PWait - wait for a time
  3. * PWait(seconds, micros)
  4. *
  5.  
  6.     INCLUDE "exec/types.i"
  7.     INCLUDE "exec/ports.i"
  8.     INCLUDE "exec/devices.i"
  9.     INCLUDE "exec/io.i"
  10.  
  11.     INCLUDE    "devices/timer.i"
  12.     INCLUDE    "macros.i"
  13.     INCLUDE    "devices/prtbase.i"
  14.  
  15.     XREF_EXE    Forbid
  16.     XREF_EXE    Permit
  17.     XREF_EXE    WaitIO
  18.  
  19.     XREF        _SysBase
  20.     XREF        _PD
  21.  
  22.     XDEF        _PWait
  23.  
  24. _PWait:
  25.         movem.l a4/a6, -(a7)
  26.         move.l    _PD,a4
  27.         move.l    pd_PBothReady(a4),a0
  28.         jsr     (a0)
  29.         tst.l    d0
  30.         bne.s    error
  31.  
  32.         lea    pd_TIOR(a4),a1
  33.         move.w    #TR_ADDREQUEST,IO_COMMAND(a1)
  34.         move.l    12(a7),IOTV_TIME+TV_SECS(a1)
  35.         move.l    16(a7),IOTV_TIME+TV_MICRO(a1)
  36.         clr.b    IO_FLAGS(a1)
  37.         move.l    IO_DEVICE(a1),a6
  38.         LINKEXE    Forbid
  39.         lea    pd_TIOR(a4),a1
  40.         LINKEXE    WaitIO
  41.         LINKEXE    Permit
  42.         moveq    #0,d0
  43.         tst.l    d0
  44. error:
  45.         movem.l    (a7)+,a4/a6
  46.         rts
  47.