home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / assembler / thesource / volume2 / source / system / asmmacros.lha / Seek.i < prev    next >
Encoding:
Text File  |  1990-11-16  |  1.1 KB  |  40 lines

  1.      NOLIST
  2. Seek        MACRO              ; 14 Mar 88
  3. *------------------------------; Start of Seek macro.
  4.                                ; Put the file handle in D1.
  5.      MOVE.L \1,D1
  6.      NOLIST
  7.      IFEQ NARG-1               ; If only the file handle was given, then
  8.      LIST
  9.      CLR.L D2                  ; Make offset be zero from current.
  10.      CLR.L D3
  11.      NOLIST
  12.      ENDC
  13.      IFEQ NARG-2               ; If offset was given without argument #3,
  14.      LIST
  15.                                ; Make offset be from the beginning.
  16.      MOVE.L #\2,D2
  17.      MOVEQ.L #-1,D3
  18.      NOLIST
  19.      ENDC
  20.      IFEQ NARG-3               ; If FromCurrent or BeforeEnd is specified,
  21.      IFC '\3','FromCurrent'
  22.      LIST
  23.      CLR.L D3                  ; Make offset from current.
  24.      MOVE.L #\2,D2
  25.      NOLIST
  26.      ENDC
  27.      IFC '\3','BeforeEnd'
  28.      LIST
  29.      MOVE.L #1,D3              ; Make offset before end.
  30.      MOVE.L #-\2,D2
  31.      NOLIST
  32.      ENDC
  33.      ENDC
  34.      LIST
  35.      CallLib Seek,dos          ; Call Seek.
  36.      CMPI.L #-1,D0             ; Make the zero flag indicate failure.
  37. *------------------------------; End of Seek macro.
  38.      ENDM
  39.      LIST
  40.