home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / z / zsim20.zip / DOS.INC < prev    next >
Text File  |  1990-05-20  |  6KB  |  152 lines

  1.  
  2. %NOLIST
  3.  
  4. ;   FILENAME: DOS.EQU
  5. ;
  6. ;   Copyright (c) 1988, 1989 by Borland International, Inc.
  7. ;
  8. ;   Description: This include file contains symbolic equates representing the
  9. ;   DOS function calls and their associated services.
  10.  
  11. FUNCTION            EQU 021h ; Dos Function call
  12. STDOUT                  EQU 001h ; File handle for Standard Output device
  13. STDERR                  EQU 002h ; File handle for Standard Error device
  14. TRUE                    EQU 0FFH
  15. FALSE                   EQU 0H
  16.  
  17. PROGRAM_TERMINATE   EQU 000h ; Terminate the program
  18. READ_KBD_ECHO       EQU 001h ; Read the keyboard and echo to the screen
  19. WRITE_CHARACTER     EQU 002h ; Output a character
  20. AUXILIARY_INPUT     EQU 003h ; Read character from auxiliary device
  21. AUXILIARY_OUTPUT    EQU 004h ; Write a character to the auxiliary device
  22. PRINTER_OUTPUT      EQU 005h ; Send character to standard list device
  23. CONSOLE_IO          EQU 006h ; Console Input/Output
  24. UNFILTERED_INPUT    EQU 007h ; Unfiltered character input without echo
  25. CHARACTER_INPUT     EQU 008h ; Character input without echo
  26. WRITE_STRING        EQU 009h ; Display a '$' terminated string
  27. BUFFERED_INPUT      EQU 00Ah ; Read text and store it in a buffer
  28. GET_INPUT_STATUS    EQU 00Bh ; Check if input is available
  29. RESET_INPUT         EQU 00Ch ; Clear the input buffer and check for input
  30. DISK_RESET          EQU 00Dh ; Flush all DOS file buffers to disk
  31. CHANGE_DISK_DRIVE   EQU 00Eh ; Set the default disk drive
  32. OPEN_FCB_FILE       EQU 00Fh ; Open a file using FCB's
  33. CLOSE_FCB_FILE      EQU 010h ; Close a file that uses FCB's
  34. FIND_FIRST_FCB      EQU 011h ; Search for the first matching file
  35. FIND_NEXT_FCB       EQU 012h ; Find the next matching file
  36. DELETE_FCB_FILE     EQU 013h ; Delete a file using FCB's
  37. SEQUENTIAL_READ     EQU 014h ; Reads the next block from a fil
  38. SEQUENTIAL_WRITE    EQU 015h ; Writes the next block of data to a file
  39. CREATE_FCB_FILE     EQU 016h ; Create and/or open a file for i/o
  40. RENAME_FCB_FILE     EQU 017h ; Rename a file using FCB's
  41. GET_DISK_DRIVE      EQU 019h ; Get the current disk drive
  42. SET_DTA             EQU 01Ah ; Set the Disk Transfer Area address
  43. DEFAULT_DRIVE_INFO  EQU 01Bh ; Get allocation information for the default drive
  44. DRIVE_INFO          EQU 01Ch ; Get allocation information for a specific drive
  45. RANDOM_READ         EQU 021h ; Perform a random file read
  46. RANDOM_WRITE        EQU 022h ; Perform random file write
  47. GET_FILE_SIZE       EQU 023h ; Get file size in records
  48. SET_RECORD_NUMBER   EQU 024h ; Set the random record number
  49. SET_VECTOR          EQU 025h ; Set an interrupt vector
  50. CREATE_PSP          EQU 026h ; Create a Program Segment Prefix(PSP)
  51. RANDOM_BLOCK_READ   EQU 027h ; Random block read of a file
  52. RANDOM_BLOCK_WRITE  EQU 028h ; Random block write to a file
  53. PARSE_FILENAME      EQU 029h ; Parse a filename
  54. GET_DATE            EQU 02Ah ; Get the DOS Date
  55. SET_DATE            EQU 02Bh ; Set the DOS Date
  56. GET_TIME            EQU 02Ch ; Get the DOS Time
  57. SET_TIME            EQU 02Dh ; Set the DOS Time
  58. SET_VERIFY_FLAG     EQU 02Eh ; Set the DOS verify flag
  59. GET_DTA             EQU 02Fh ; Get the DTA address
  60. GET_VERSION         EQU 030h ; Get the MS-DOS Version #
  61. KEEP                EQU 031h ; Terminate and stay resident
  62. GET_SET_CTRL_BREAK  EQU 033h ; Get or set the Ctrl-Break flag
  63. GET_VECTOR          EQU 035h ; Get the interrupt vector
  64. GET_DISK_SPACE      EQU 036h ; Returns allocation info. about a disk
  65. GET_SET_COUNTRY     EQU 038h ; Get or set the current info. about the country
  66. MAKE_DIRECTORY      EQU 039h ; Create a directory
  67. DELETE_DIRECTORY    EQU 03Ah ; Delete a directory
  68. SET_CURRENT_DIR     EQU 03Bh ; Set the current directory
  69. CREATE_FILE         EQU 03Ch ; Create or truncate a file
  70. OPEN_FILE           EQU 03Dh ; Open an existing file
  71. CLOSE_FILE          EQU 03Eh ; Close a file
  72. READ_FROM_HANDLE    EQU 03Fh ; Read from DOS file handle
  73. WRITE_TO_HANDLE     EQU 040h ; Write to File Handle
  74. DELETE_FILE         EQU 041h ; Delete a file
  75. MOVE_FILE_POINTER   EQU 042h ; Move the file pointer
  76. GET_SET_ATTRIBUTES  EQU 043h ; Get/Set File Attributes
  77. IOCTL               EQU 044h ; Device-driver control
  78. DUPLICATE_HANDLE    EQU 045h ; Duplicate file handle
  79. FORCE_DUP_HANDLE    EQU 046h ; Force duplicate file handles
  80. GET_DIRECTORY       EQU 047h ; Get the current directory
  81. ALLOCATE_MEMORY     EQU 048h ; Allocate memory blocks
  82. FREE_MEMORY         EQU 049h ; Release memory blocks
  83. MODIFY_MEMORY       EQU 04Ah ; Modify a memory block
  84. EXEC                EQU 04Bh ; Execute a program
  85. TERMINATE_EXE       EQU 04Ch ; Terminate program
  86. GET_RETURN_CODE     EQU 04Dh ; Get DOS return code
  87. FIND_FIRST          EQU 04Eh ; Find first directory entry
  88. FIND_NEXT           EQU 04Fh ; Find next directory entry
  89. GET_VERIFY_FLAG     EQU 054h ; Get the value of DOS's verify flag
  90. RENAME_FILE         EQU 056h ; Rename a file
  91. GET_SET_DATE_TIME   EQU 057h ; Read or Modify the time and date of a file
  92. GET_SET_ALLOCATION  EQU 058h ; Get or set DOS's memory allocation strategy
  93. GET_EXTENDED_ERRORS EQU 059h ; Get more detailed info. about a DOS error
  94. CREATE_TEMP_FILE    EQU 05Ah ; Create a temporary file
  95. CREATE_NEW_FILE     EQU 05Bh ; Create a new file
  96. CONTROL_ACCESS      EQU 05Ch ; Set access ability to a region in a file
  97.  
  98. NET_HARDWARE        EQU 05Eh ; Microsoft Network hardware info.
  99.  
  100. NET_GET_MACHINE_NAME    EQU 000h ; Get the name of the local machine
  101. NET_SET_PRINTER_SETUP   EQU 002h ; Set the printer's setup
  102. NET_GET_PRINTER_SETUP   EQU 003h ; Get the printer's setup
  103.  
  104. NET_SYSTEM          EQU 05Fh ; Microsoft Network system info.
  105.  
  106. NET_GET_REDIRECTION_LIST    EQU 002h ; Inspect the system redirection list
  107. NET_REDIRECT_DEVICE         EQU 003h ; Redirect a device
  108. NET_CANCEL_REDIRECT         EQU 004h ; Cancel the redirection of a device
  109.  
  110. GET_PSP             EQU 062h ; Get Program Segment Prefix(PSP)
  111. GET_LEAD_BYTE_TABLE EQU 063h ; Get the address of the system table
  112.  
  113. DOS MACRO X
  114.     MOV AH,X
  115.     INT FUNCTION
  116. ENDM
  117.  
  118. LOG2 MACRO X  ; CL:=LOG2(X)
  119. LOCAL Y,L
  120.   Y = 1
  121.   L = 0
  122.   REPT 17
  123.     IF (Y EQ X)
  124.        EXITM
  125.     ENDIF
  126.     Y=Y*2
  127.     L=L+1
  128.   ENDM
  129.   IF L EQ 17
  130.      %OUT WARNING: LOG2(X>2^16)
  131.   ELSE
  132.      MOV CL,L
  133.   ENDIF
  134. ENDM
  135.  
  136. PUSHR MACRO REGS
  137. LOCAL REG
  138. ;; EXAPL: PUSHR <BX,AX,CX>
  139.    IRP REG,<REGS>
  140.      PUSH REG
  141.    ENDM
  142. ENDM
  143.  
  144. POPR  MACRO REGS
  145. LOCAL REG
  146. ;; EXAPL: POPR  <BX,AX,CX>
  147.    IRP REG,<REGS>
  148.      POP  REG
  149.    ENDM
  150. ENDM
  151.  
  152. %LIST