Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
5.3 KiB

  1. ;-----------------------------------------------------------------------
  2. ;
  3. ; MS-DOS definitions for C runtime
  4. _NFILE equ 20 ; maximum # files per process
  5. STACKSLOP equ 150 ; stack slop for interrupt overhead
  6. ; __osfile flag values for DOS file handles
  7. FOPEN equ 01H ; file handle open
  8. FEOFLAG equ 02H ; end of file has been encountered
  9. FDEV equ 40H ; file handle refers to device
  10. FTEXT equ 80H ; file handle is in text mode
  11. FAPPEND equ 20H ; file handle opened O_APPEND
  12. FRDONLY equ 10H ; file handle associated with read only file
  13. callos MACRO func
  14. ifnb <func>
  15. mov ah,DOS_&func
  16. endif
  17. int DOS
  18. ENDM
  19. DOS equ 21H ; MS-DOS interrupt
  20. DOS_exit equ 00000H ; exit offset (PSP:0000)
  21. DOS_maxpara equ 00002H ; maximum paragraph (PSP:0002)
  22. DOS_envp equ 0002cH ; environment address (PSP:002c)
  23. DOS_cmdline equ 00080H ; command line offset (PSP:0080)
  24. DOS_kill equ 00H ; terminate
  25. DOS_echoread equ 01H ; read keyboard and echo
  26. DOS_display equ 02H ; display character
  27. DOS_auxinput equ 03H ; auxiliary input
  28. DOS_auxoutput equ 04H ; auxiliary output
  29. DOS_print equ 05H ; print character
  30. DOS_conio equ 06H ; direct console i/o
  31. DOS_coninput equ 07H ; direct console input
  32. DOS_readkbd equ 08H ; read keyboard
  33. DOS_message equ 09H ; display string
  34. DOS_bufkbdin equ 0aH ; buffered keyboard input
  35. DOS_kbdstatus equ 0bH ; check keyboard status
  36. DOS_flshread equ 0cH ; flush buffer and read keyboard
  37. DOS_diskreset equ 0dH ; disk reset
  38. DOS_selectdisk equ 0eH ; select default disk
  39. DOS_fcbopen equ 0fH ; open file with fcb
  40. DOS_fcbclose equ 10H ; close file with fcb
  41. DOS_fcbfirst equ 11H ; search for first entry with fcb
  42. DOS_fcbnext equ 12H ; search for next entry with fcb
  43. DOS_fcbdelete equ 13H ; delete file with fcb
  44. DOS_fcbsread equ 14H ; sequential read with fcb
  45. DOS_fcbswrite equ 15H ; sequential write with fcb
  46. DOS_fcbcreate equ 16H ; create file with fcb
  47. DOS_fcbrename equ 17H ; rename file with fcb
  48. DOS_currentd equ 19H ; current default disk
  49. DOS_setDMA equ 1aH ; set DMA
  50. DOS_fcbrread equ 21H ; random read with fcb
  51. DOS_fcbrwrite equ 22H ; random write with fcb
  52. DOS_fcbsize equ 23H ; file size with fcb
  53. DOS_fcbsetrec equ 24H ; set relative record with fcb
  54. DOS_setvector equ 25H ; set interrupt vector
  55. DOS_fcbbread equ 27H ; random block read with fcb
  56. DOS_fcbbwrite equ 28H ; random block write with fcb
  57. DOS_fcbparse equ 29H ; parse file name with fcb
  58. DOS_getdate equ 2aH ; get date
  59. DOS_setdate equ 2bH ; set date
  60. DOS_gettime equ 2cH ; get time
  61. DOS_settime equ 2dH ; set time
  62. DOS_verify equ 2eH ; set/reset verify flag
  63. DOS_getDMA equ 2fH ; get DMA
  64. DOS_version equ 30H ; get version number
  65. DOS_keep equ 31H ; keep process
  66. DOS_cntlc equ 33H ; Cntl-C check
  67. DOS_getvector equ 35H ; get interrupt vector
  68. DOS_getdskspc equ 36H ; get disk free space
  69. DOS_country equ 38H ; get country dependent info
  70. DOS_mkdir equ 39H ; make subdirectory
  71. DOS_rmdir equ 3aH ; remove subdirectory
  72. DOS_chdir equ 3bH ; change subdirectory
  73. DOS_create equ 3cH ; create pathname
  74. DOS_open equ 3dH ; open pathname
  75. DOS_close equ 3eH ; close file handle
  76. DOS_read equ 3fH ; read from file handle
  77. DOS_write equ 40H ; write from file handle
  78. DOS_delete equ 41H ; delete pathname
  79. DOS_lseek equ 42H ; move file pointer
  80. DOS_filemode equ 43H ; get/set attributes of pathname
  81. DOS_ioctl equ 44H ; ioctl for devices
  82. DOS_dup equ 45H ; duplicate file handle
  83. DOS_forcedup equ 46H ; force duplicate file handle
  84. DOS_curdir equ 47H ; get current directory
  85. DOS_allocmem equ 48H ; allocate memory block
  86. DOS_freemem equ 49H ; free memory block
  87. DOS_setmem equ 4aH ; set size of memory block
  88. DOS_exec equ 4bH ; load and execute program
  89. DOS_terminate equ 4cH ; terminate process with errorcode
  90. DOS_wait equ 4dH ; get child process return code
  91. DOS_findfirst equ 4eH ; find first file match
  92. DOS_findnext equ 4fH ; find next file match
  93. DOS_getverify equ 54H ; return current verify flag
  94. DOS_rename equ 56H ; rename pathname
  95. DOS_filedate equ 57H ; get/set file handle date/time
  96. DOS_locking equ 5CH ; file record locking/unlocking
  97. DOS_sleep equ 89H ; delay process execution
  98. ; DOS error codes
  99. doserr MACRO num,name,text
  100. name equ num
  101. ENDM
  102. doserr 1, E_ifunc, <invalid function code>
  103. doserr 2, E_nofile, <file not found>
  104. doserr 3, E_nopath, <path not found>
  105. doserr 4, E_toomany, <too many open files>
  106. doserr 5, E_access, <access denied>
  107. doserr 6, E_ihandle, <invalid handle>
  108. doserr 7, E_arena, <arena trashed>
  109. doserr 8, E_nomem, <not enough memory>
  110. doserr 9, E_iblock, <invalid block>
  111. doserr 10, E_badenv, <bad environment>
  112. doserr 11, E_badfmt, <bad format>
  113. doserr 12, E_iaccess, <invalid access code>
  114. doserr 13, E_idata, <invalid data>
  115. doserr 14, E_unknown, <??? unknown error ???>
  116. doserr 15, E_idrive, <invalid drive>
  117. doserr 16, E_curdir, <current directory>
  118. doserr 17, E_difdev, <not same device>
  119. doserr 18, E_nomore, <no more files>
  120. doserr 19, E_maxerr2, <unknown error - Version 2.0>
  121. ; the following errors can occur only in DOS 3.0
  122. doserr 32, E_sharerr, <sharing violation>
  123. doserr 33, E_lockerr, <locking violation>
  124. doserr 34, E_maxerr3, <unknown error - Version 3.0>
  125. ; DOS file attributes
  126. A_ro equ 01H ; read-only file
  127. A_h equ 02H ; hidden
  128. A_s equ 04H ; system
  129. A_v equ 08H ; volume ID
  130. A_d equ 10H ; directory
  131. A_a equ 20H ; archive
  132. A_mod equ A_ro+A_h+A_s+A_a ; modifiable attributes
  133. ; end of msdos.inc
  134. ;-----------------------------------------------------------------------
  135.