home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Fortran.51 / DISK5 / MSDOS.IN$ / MSDOS.bin
Text File  |  1989-09-27  |  6KB  |  184 lines

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