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 / Write.i < prev   
Encoding:
Text File  |  1990-11-16  |  1.4 KB  |  48 lines

  1.      NOLIST
  2. Write       MACRO              ; 12 Jan 88
  3. *------------------------------; Start of Write macro.
  4.                                ; Put the file handle in D1.
  5.      MOVE.L \3,D1
  6.                                ; Make D2 point to the start of the buffer.
  7.      NOLIST
  8.      IFC '\1','D'
  9.      LIST
  10.      MOVE.L #\2,D2
  11.      NOLIST
  12.      ENDC
  13.      IFC '\1','I'
  14.      LIST
  15.      MOVE.L \2.Adr,D2
  16.      NOLIST
  17.      ENDC
  18.      IFEQ NARG-3               ; If there is no fourth argument, and
  19.      IFC '\1','D'              ;  <BufferStartAddr> is specified, then
  20.      LIST
  21.                                ; Calculate the buffer size as
  22.                                ;  <BufferStartAddr>End minus
  23.                                ;  <BufferStartAddr>. Put it in D3.
  24.      MOVE.L #\2End-\2,D3
  25.      NOLIST
  26.      ENDC
  27.      IFC '\1','I'              ; If <MemBlockName> is specified, then
  28.      LIST
  29.                                ; Get the buffer size from <MemBlockName>.Size
  30.      MOVE.L \2.Size,D3
  31.      NOLIST
  32.      ENDC
  33.      ENDC
  34.      IFEQ NARG-4               ; If the fourth argument exists,
  35.      IFNC '\4','D3'            ;  and it is not "D3", then
  36.      LIST
  37.                                ; Use the buffer size of the fourth argument.
  38.      MOVE.L #\4,D3
  39.      NOLIST
  40.      ENDC
  41.      ENDC
  42.      LIST
  43.      CallLib Write,dos         ; Call Write.
  44.      CMPI.L #-1,D0             ; Make the zero flag indicate failure.
  45. *------------------------------; End of Write macro.
  46.      ENDM
  47.      LIST
  48.