home *** CD-ROM | disk | FTP | other *** search
- NOLIST
- Write MACRO ; 12 Jan 88
- *------------------------------; Start of Write macro.
- ; Put the file handle in D1.
- MOVE.L \3,D1
- ; Make D2 point to the start of the buffer.
- NOLIST
- IFC '\1','D'
- LIST
- MOVE.L #\2,D2
- NOLIST
- ENDC
- IFC '\1','I'
- LIST
- MOVE.L \2.Adr,D2
- NOLIST
- ENDC
- IFEQ NARG-3 ; If there is no fourth argument, and
- IFC '\1','D' ; <BufferStartAddr> is specified, then
- LIST
- ; Calculate the buffer size as
- ; <BufferStartAddr>End minus
- ; <BufferStartAddr>. Put it in D3.
- MOVE.L #\2End-\2,D3
- NOLIST
- ENDC
- IFC '\1','I' ; If <MemBlockName> is specified, then
- LIST
- ; Get the buffer size from <MemBlockName>.Size
- MOVE.L \2.Size,D3
- NOLIST
- ENDC
- ENDC
- IFEQ NARG-4 ; If the fourth argument exists,
- IFNC '\4','D3' ; and it is not "D3", then
- LIST
- ; Use the buffer size of the fourth argument.
- MOVE.L #\4,D3
- NOLIST
- ENDC
- ENDC
- LIST
- CallLib Write,dos ; Call Write.
- CMPI.L #-1,D0 ; Make the zero flag indicate failure.
- *------------------------------; End of Write macro.
- ENDM
- LIST
-