home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / turbo55 / tp55 / tasm / idos.mac < prev    next >
Text File  |  1989-05-01  |  3KB  |  140 lines

  1.  
  2. ;   FILENAME: IDOS.MAC
  3. ;
  4. ;   Copyright (c) 1988, 1989 by Borland International, Inc.
  5. ;
  6. ;   DESCRIPTION: This include file contains various macros that may
  7. ;   be used to communicate with DOS. This include file uses Ideal mode
  8. ;   syntax. For documentation on each of the macros in this file see the
  9. ;   file DOSMAC.DOC.
  10. ;
  11. ;   NOTE: In order to use this macro file you must also include the files:
  12. ;   IMACROS.MAC, KBD.EQU, and DOS.EQU in your module.
  13. ;
  14.  
  15. macro   Terminate10Program
  16.     DosCall <DOS_PROGRAM_TERMINATE>
  17. endm
  18.  
  19. macro   ReadKBDEcho
  20.     DosCall <DOS_READ_KBD_ECHO>
  21. endm
  22.  
  23. macro   CharacterOutput Character
  24.     ifb <Character>
  25.         display "Caller must provide Character parameter to CharacterOutput."
  26.         err
  27.     else
  28.         mov     dl, Character
  29.         DosCall <DOS_WRITE_CHARACTER>
  30.     endif
  31. endm
  32.  
  33. macro   AuxiliaryInput
  34.     DosCall <DOS_AUXILIARY_INPUT>
  35. endm
  36.  
  37. macro   AuxiliaryOutput Character
  38.     ifb <Character>
  39.         display "Caller must provide Character parameter to AuxiliaryOutput."
  40.         err
  41.     else
  42.         mov     dl, <Character>
  43.         DosCall <DOS_AUXILIARY_OUTPUT>
  44.     endif
  45. endm
  46.  
  47. macro   PrinterOutput   Character
  48.     ifb <Character>
  49.         display "Caller must provide Character parameter to PrinterOutput."
  50.         err
  51.     else
  52.         mov     dl, <Character>
  53.         DosCall <DOS_PRINTER_OUTPUT>
  54.     endif
  55. endm
  56.  
  57. macro   ConsoleIO   Value
  58.     ifb <Value>
  59.         display "Caller must provide the Value parameter to ConsoleIO."
  60.         err
  61.     else
  62.         mov     dl, Value
  63.         DosCall <DOS_CONSOLE_IO>
  64.     endif
  65. endm
  66.  
  67. macro   UnfilteredCharInput
  68.     DosCall <DOS_UNFILTERED_INPUT>
  69. endm
  70.  
  71. macro   CharInputNoEcho
  72.     DosCall <DOS_CHARACTER_INPUT>
  73. endm
  74.  
  75. macro   WriteString StringSeg, StringOfs
  76.     macro   ErrMsg
  77.         display "You must provide the string address parameters to WriteString."
  78.         err
  79.     endm
  80.  
  81.     ifb <StringSeg>
  82.         ErrMsg
  83.     else
  84.         ifb <StringOfs>
  85.             ErrMsg
  86.         else
  87.             ifidni  <StringSeg>, <ds>
  88.                 ; Do nothing
  89.             else
  90.                 LoadSegment <ds>, <StringSeg>
  91.             endif
  92.             mov     dx, StringOfs
  93.             DosCall DOS_WRITE_STRING
  94.         endif
  95.     endif
  96. endm
  97.  
  98. macro   BufferedInput   StringSeg, StringOfs
  99.     macro   ErrMsg
  100.         display "Caller must provide the address parameters to BufferedInput."
  101.         err
  102.     endm
  103.  
  104.     ifb <StringSeg>
  105.         ErrMsg
  106.     else
  107.         ifb <StringOfs>
  108.             ErrMsg
  109.         else
  110.             ifidni  <ds>, <StringSeg>
  111.                 ; Do nothing
  112.             else
  113.                 LoadSegment <ds>, <StringSeg>
  114.             endif
  115.             mov     dx, StringOfs
  116.             DosCall <DOS_BUFFERED_INPUT>
  117.         endif
  118.     endif
  119. endm
  120.  
  121. macro   GetInputStatus
  122.     DosCall <DOS_GET_INPUT_STATUS>
  123. endm
  124.  
  125. macro   ResetInputBuffer    Function, StringSeg, StringOfs
  126.     ifb <Function>
  127.         display "Caller must provide the Function parameter to ResetInputBuffer."
  128.         err
  129.     else
  130.         ifb <StringSeg>
  131.             mov     al, Function
  132.         else
  133.             ifb <StringOfs>
  134.                 display "Caller must provide the StringOfs parameter to ResetInputBuffer."
  135.                 err
  136.             else
  137.                 ifidni  <ds>, <StringSeg>
  138.                     ; Do nothing
  139.                 else
  140.                     Loa