home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 19 / af019.adf / Macros / DosMACROS.i next >
Text File  |  1978-04-04  |  1KB  |  69 lines

  1. *Macros for use with the DOS library
  2.  
  3. * Contains
  4. * MACRO    OpenFile    (FileName, Mode, [FileHandler])
  5. * MACRO    CloseFile    (FileHandler)
  6. * MACRO    ReadFile    (FileHandler, Buffer, Length)
  7. * MACRO    DisplayTextCLI    (TextStartAddress, TextEndAddress)
  8. * MACRO    GetCLIHandler    ([CLIHandler])
  9. * MACRO    DisplayTextCLIH    (CLIHandler, TextStartAddress, TextEndAddress)
  10.  
  11.     IFND    Open
  12. Open    equ    -30
  13. Close    equ    -36
  14. Read    equ    -42
  15. Input    equ    -54
  16. Write    equ    -48
  17.     ENDC
  18.  
  19.     IFND    MODE_OLDFILE
  20. MODE_OLDFILE    equ    1005
  21. MODE_NEWFILE    equ    1006
  22. MODE_READWRITE    equ    1004
  23.     ENDC
  24.  
  25. OpenFile    MACRO
  26.     move.l    Dos_Base,a6
  27.     move.l    \1,d1
  28.     move.l    #\2,d2
  29.     jsr    Open(a6)
  30.     move.l    d0,\3
  31.     ENDM
  32.  
  33. CloseFile    MACRO
  34.     move.l    Dos_Base,a6
  35.     move.l    \1,d1
  36.     jsr    Close(a6)
  37.     ENDM
  38.  
  39. ReadFile    MACRO
  40.     move.l    Dos_Base,a6
  41.     move.l    \1,d1
  42.     move.l    \2,d2
  43.     move.l    \3,d3
  44.     jsr    Read(a6)
  45.     ENDM
  46.  
  47. DisplayTextCLI    MACRO
  48.     move.l    Dos_Base,a6
  49.     jsr    Input(a6)
  50.     move.l    d0,d1
  51.     move.l    #\1,d2
  52.     move.l    #\2-\1,d3
  53.     jsr    Write(a6)
  54.     ENDM
  55.  
  56. GetCLIHandler    MACRO
  57.     move.l    Dos_Base,a6
  58.     jsr    Input(a6)
  59.     move.l    d0,\1
  60.     ENDM
  61.  
  62. DisplayTextCLIH    MACRO
  63.     move.l    Dos_Base,a6
  64.     move.l    \1,d1
  65.     move.l    #\2,d2
  66.     move.l    #\3-\2,d3
  67.     jsr    Write(a6)
  68.     ENDM
  69.