home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / tasm / dosmac.doc < prev    next >
Text File  |  1988-08-28  |  52KB  |  1,667 lines

  1.  
  2. FILENAME: DOSMAC.DOC
  3.  
  4. DESCRIPTION: This file documents the macros implemented in the files IDOS.MAC
  5. and MDOS.MAC. Note that the only difference between the two macro files is that
  6. IDOS.MAC uses TASM's Ideal mode while MDOS.MAC uses TASM's Masm mode.
  7.  
  8.  
  9. Terminate10Program
  10. ------------------
  11. Function: Terminate a program without returning an errorlevel to DOS.
  12. DOS Function: 00h
  13. DOS Versions: 1, 2, 3
  14. Input
  15.     cs - segment address of Program Segment Prefix(PSP)
  16. Output
  17.     none
  18. Registers modified: ah, flags
  19. Syntax: Terminate10Program
  20.  
  21.  
  22. ReadKBDEcho
  23. -----------
  24. Function: Reads a character from the keyboard or standard input device and
  25.           echoes it to the display. If a character isn't immediately available
  26.           the DOS function waits for one.
  27. DOS Function: 01h
  28. DOS Versions: 1, 2, 3
  29. Input
  30.     none
  31. Output
  32.     al - character Registers modified: , flags
  33. Syntax: ReadKBDEcho
  34.  
  35.  
  36. CharacterOutput
  37. ---------------
  38. Function: Outputs a character to the standard output device or to the active
  39.           video display.
  40. DOS Function: 02h
  41. DOS Versions: 1, 2, 3
  42. Input
  43.     Character - byte value representing character to display
  44. Output
  45.     none
  46. Registers modified: ah, dl, flags
  47. Syntax: CharacterOutput Character
  48.  
  49.  
  50. AuxiliaryInput
  51. --------------
  52. Function: Reads the next character from the auxiliary input device.
  53. DOS Function: 03h
  54. DOS Versions: 1, 2, 3
  55. Input
  56.     none
  57. Output
  58.     al - byte value representing the character received
  59. Registers modified: ax, flags
  60. Syntax: AuxiliaryInput
  61.  
  62. AuxiliaryOutput
  63. ---------------
  64. Function: Displays a character to the auxiliary output device.
  65. DOS Function: 04h
  66. DOS Versions: 1, 2, 3
  67. Input
  68.     Character - byte value representing character to display
  69. Output
  70.     none
  71. Registers modified: ax, dl, flags
  72. Syntax: AuxiliaryOutput
  73.  
  74.  
  75. PrinterOutput
  76. -------------
  77. Function: Sends a character to the printer device.
  78. DOS Function: 05h
  79. DOS Versions: 1, 2, 3
  80. Input
  81.     Character - value to send to the printer.
  82. Output
  83.     none
  84. Registers modified: ah, dl, flags
  85. Syntax: PrinterOutput   Character
  86.  
  87.  
  88. ConsoleIO
  89. ---------
  90. Function: Performs input/output from/to the console device.
  91. DOS Function: 06h
  92. DOS Versions: 1, 2, 3
  93. Input
  94.     Function - Desired operation as defined below
  95.     Value       Behavior
  96.     ---------------------------------------------------
  97.     0-0FEh      Display the character represented by Value
  98.     FFh         Read a character
  99. Output
  100.     Value = FF
  101.         A character is available
  102.             zero flag = clear
  103.             al - character
  104.         A character is not available
  105.             zero flag set
  106. Registers modified: ax, dl, flags
  107. Syntax: ConsoleIO   Value
  108.  
  109. UnfilteredCharInput
  110. -------------------
  111. Function: Performs character input without checking for CTRL_BREAK. The
  112.           character input is not written to the display device.
  113. DOS Function: 07h
  114. DOS Versions: 1, 2, 3
  115. Input
  116.     none
  117. Output
  118.     al - The character read.
  119. Registers modified: ax, flags
  120. Syntax: UnfilteredCharInput
  121.  
  122. CharInputNoEcho
  123. ---------------
  124. Function: Reads a character without echoing it to the screen.
  125. DOS Function: 08h
  126. DOS Versions: 1, 2, 3
  127. Input
  128.     none
  129. Output
  130.     al - character read
  131. Registers modified: ax, flags
  132. Syntax: CharInputNoEcho
  133.  
  134. WriteString
  135. -----------
  136. Function: Displays a $ terminated string to the string using.
  137. DOS Function: 09h
  138. DOS Versions: 1, 2, 3
  139. Input
  140.     StringSeg - segment address of the string
  141.     StringOfs - offset address of string in StringSeg
  142. Output
  143.     none
  144. Registers modified: ax, dx, ds, Flags
  145. Syntax: WriteString StringSeg, StringOfs
  146.  
  147. BufferedInput
  148. -------------
  149. Function: Reads a line from the standard input device and stores it in the
  150.           indicated buffer.
  151. DOS Function: 0Ah
  152. DOS Versions: 1, 2, 3
  153. Input
  154.     StringSeg - segment address of the buffer
  155.     StringOfs - offset of the storage buffer
  156. Output
  157.     none
  158. Registers modified: ah, dx, ds, flags
  159. Syntax: BufferedInput   StringSeg, StringOfs
  160.  
  161. GetInputStatus
  162. --------------
  163. Function: Determines if a character is ready to be input.
  164. DOS Function: 0Bh
  165. DOS Versions: 1, 2, 3
  166. Input
  167.     none
  168. Output
  169.     al - 0 = no character available, FFh = character available
  170. Registers modified: ax, flags
  171. Syntax: GetInputStatus
  172.  
  173. ResetInputBuffer
  174. ----------------
  175. Function: Resets the input buffer(i.e. clears its contents) and then waits for
  176.           a character. Note that if Function <> 0Ah you do not need to provide
  177.           the StringSeg:StringOfs parameters.
  178. DOS Function: 0Ch
  179. DOS Versions: 1, 2, 3
  180. Input
  181.     Function - number of the input function to invoke.
  182.     StringSeg - If Function = 0Ah, segment address of the buffer
  183.     StringOfs - offset of storage buffer
  184. Output
  185.     Function = 0Ah
  186.         none
  187.     al - character read
  188. Registers modified: ax, dx, ds, flags
  189. Syntax: ResetInputBuffer    Function, StringSeg, StringOfs
  190.  
  191. ResetDisk
  192. ---------
  193. Function: Resets a disk. All buffers are flushed to the disk.
  194. DOS Function: 0Dh
  195. DOS Versions: 1, 2, 3
  196. Input
  197.     none
  198. Output
  199.     none
  200. Registers modified: ah, flags
  201. Syntax: ResetDisk
  202.  
  203. ChangeDrive
  204. -----------
  205. Function: Changes the default disk drive.
  206. DOS Function: 0Eh
  207. DOS Versions: 1, 2, 3
  208. Input
  209.     Drive - Drive to change to
  210. Output
  211.     al - number of logical drives in system
  212. Registers modified: al, dl, Flags
  213. Syntax: ChangeDrive Drive
  214.  
  215. OpenFCBFile
  216. -----------
  217. Function: Opens a file using an FCB and prepares it for I/O.
  218. DOS Function: 0Fh
  219. DOS Versions: 1, 2, 3
  220. Input
  221.     FCBSeg - segment address of the File Control Block(FCB)
  222.     FCBOfs - offset of FCB
  223. Output
  224.     al - 0 = operation successful, FFh = operation failed
  225. Registers modified: ax, dx, ds, flags
  226. Syntax: OpenFCBFile FCBSeg, FCBOfs
  227.  
  228. CloseFCBFile
  229. ------------
  230. Function: Closes a file using an FCB.
  231. DOS Function: 10h
  232. DOS Versions: 1, 2, 3
  233. Input
  234.     FCBSeg - segment address of the File Control Block(FCB)
  235.     FCBOfs - offset of FCB
  236. Output
  237.     al - 0 = operation successful, FFh = operation failed
  238. Registers modified: ax, dx, ds, flags
  239. Syntax: CloseFCBFile    FCBSeg, FCBOfs
  240.  
  241. FindFirstFCB
  242. ------------
  243. Function: Finds the first file in a directory that matches a given file
  244.           specification. Fiel operations are performed using FCB's.
  245. DOS Function: 11h
  246. DOS Versions: 1, 2, 3
  247. Input
  248.     FCBSeg - segment address of the File Control Block(FCB)
  249.     FCBOfs - offset of FCB
  250. Output
  251.     al - 0 = operation successful, FFh = operation failed
  252. Registers modified: ax, dx, ds, flags
  253. Syntax: FindFirstFCB    FCBSeg, FCBOfs
  254.  
  255. FindNextFCB
  256. -----------
  257. Function: Finds the next entry in a directory matching the last file
  258.           specification given to FindFirstFCB.
  259. DOS Versions: 1, 2, 3
  260. Input
  261.     FCBSeg - segment address of the File Control Block(FCB)
  262.     FCBOfs - offset of FCB
  263. Output
  264.     al - 0 = operation successful, FFh = operation failed
  265. Registers modified: ax, dx, ds, flags
  266. Syntax: FindNextFCB    FCBSeg, FCBOfs
  267.  
  268. DeleteFCBFile
  269. -------------
  270. Function: Deletes a file defined in an FCB.
  271. DOS Function: 13h
  272. DOS Versions: 1, 2, 3
  273. Input
  274.     FCBSeg - segment address of the File Control Block(FCB)
  275.     FCBOfs - offset of FCB
  276. Output
  277.     al - 0 = operation successful, FFh = operation failed
  278. Registers modified: ax, dx, ds, flags
  279. Syntax: DeleteFCBFile    FCBSeg, FCBOfs
  280.  
  281. SequentialFCBRead
  282. -----------------
  283. Function: Performs a sequential read from a file opened using an FCB.
  284. DOS Function: 14h
  285. DOS Versions: 1, 2, 3
  286. Input
  287.     FCBSeg - segment address of the File Control Block(FCB)
  288.     FCBOfs - offset of FCB
  289. Output
  290.     al - 0 = read successful
  291.          1 = end of file
  292.          2 = segment wrap
  293.          3 = partial record read at eof
  294. Registers modified: ax, dx, ds, flags
  295. Syntax: SequentialFCBRead   FCBSeg, FCBOfs
  296.  
  297. SequentialFCBWrite
  298. ------------------
  299. Function: Performs a sequential write to a file opened using an FCB.
  300. DOS Function: 15h
  301. DOS Versions: 1, 2, 3
  302. Input
  303.     FCBSeg - segment address of the File Control Block(FCB)
  304.     FCBOfs - offset of FCB
  305. Output
  306.     al - 0 = write successful
  307.          1 = disk full
  308.          2 = segment wrap
  309. Registers modified: ax, dx, ds, flags
  310. Syntax: SequentialFCBWrite  FCBSeg, FCBOfs
  311.  
  312. CreateFCBFile
  313. -------------
  314. Function: Creates a new file or truncates an existing file using an FCB.
  315. DOS Function: 16h
  316. DOS Versions: 1, 2, 3
  317. Input
  318.     FCBSeg - segment address of the File Control Block(FCB)
  319.     FCBOfs - offset of FCB
  320. Output
  321.     al - 0 = operation successful, FFh = operation failed
  322. Registers modified: ax, dx, ds, flags
  323. Syntax: CreateFCBFile   FCBSeg, FCBOfs
  324.  
  325. RenameFCBFile
  326. -------------
  327. Function: Renames a file(s) defined in an FCB.
  328. DOS Function: 17h
  329. DOS Versions: 1, 2, 3
  330. Input
  331.     FCBSeg - segment address of the File Control Block(FCB)
  332.     FCBOfs - offset of FCB
  333. Output
  334.     al - 0 = operation successful, FFh = operation failed
  335. Registers modified: ax, dx, ds, flags
  336. Syntax: RenameFCBFile   FCBSeg, FCBOfs
  337.  
  338. GetDrive
  339. --------
  340. Function: Returns the default disk drive.
  341. DOS Function: 19h
  342. DOS Versions: 1, 2, 3
  343. Input
  344.     none
  345. Output
  346.     al - drive code(0 = A, 1 = B, etc.)
  347. Registers modified: al, Flags
  348. Syntax: GetDrive
  349.  
  350. SetDTA
  351. ------
  352. Function: Sets the current DTA address.
  353. DOS Function: 1Ah
  354. DOS Versions: 1, 2, 3
  355. Input
  356.     StringSeg - segment address of new DTA
  357.     DTAOfs - offset in StringSeg of new DTA
  358. Output
  359.     none
  360. Registers modified: ax, dx, ds, Flags
  361. Syntax: SetDTA  DTASeg, DTAOfs
  362.  
  363. DefaultDiskAllocation
  364. ---------------------
  365. Function: Gets the allocation information for the default disk drive.
  366. DOS Function: 1Bh
  367. DOS Versions: 1, 2, 3
  368. Input
  369.     none
  370. Output
  371.     al - sectors per cluster
  372.     ds:bx - address of the FAT id byte
  373.     cx - # of bytes per physical sector
  374.     dx - number of clusters on default drive
  375. Registers modified: ax, bx, cx, dx, ds, flags
  376. Syntax: DefaultDiskAllocation
  377.  
  378. DiskAllocation
  379. --------------
  380. Function: Gets the allocation information for a specific disk drive.
  381. DOS Function: 1Ch
  382. DOS Versions: 2, 3
  383. Input
  384.     dl - drive id(0 = default, 1 = A, etc.)
  385. Output
  386.     al - sectors per cluster
  387.     ds:bx - address of the FAT id byte
  388.     cx - # of bytes per physical sector
  389.     dx - number of clusters on default drive
  390. Registers modified: ax, bx, cx, dx, ds, flags
  391. Syntax: DiskAllocation  Drive
  392.  
  393. RandomFCBRead
  394. -------------
  395. Function: Reads the indicated record from a file opened using an FCB.
  396. DOS Function: 21h
  397. DOS Versions: 1, 2, 3
  398. Input
  399.     FCBSeg - segment address of the File Control Block(FCB)
  400.     FCBOfs - offset of FCB
  401. Output
  402.     al - 0 = read successful
  403.          1 = end of file
  404.          2 = segment wrap
  405.          3 = partial record read at eof
  406. Registers modified: ax, dx, ds, flags
  407. Syntax: RandomFCBRead   FCBSeg, FCBOfs
  408.  
  409. RandomFCBWrite
  410. --------------
  411. Function: Writes a record to the indicated position in a file opened using an
  412.           FCB.
  413. DOS Function: 22h
  414. DOS Versions: 1, 2, 3
  415. Input
  416.     FCBSeg - segment address of the File Control Block(FCB)
  417.     FCBOfs - offset of FCB
  418. Output
  419.     al - 0 = write successful
  420.          1 = disk full
  421.          2 = segment wrap
  422. Registers modified: ax, dx, ds, flags
  423. Syntax: RandomFCBWrite  FCBSeg, FCBOfs
  424.  
  425. GetFCBFileSize
  426. --------------
  427. Function: Gets the number of records in a file opened using an FCB.
  428. DOS Function: 23h
  429. DOS Versions: 1, 2, 3
  430. Input
  431.     FCBSeg - segment address of the File Control Block(FCB)
  432.     FCBOfs - offset of FCB
  433. Output
  434.     al - 0 = operation successful, FFh = operation failed
  435. Registers modified: ax, dx, ds, flags
  436. Syntax: GetFCBFileSize  FCBSeg, FCBOfs
  437.  
  438. SetFCBFileRecord
  439. ----------------
  440. Function: Updates the record pointer field in the FCB to the current file
  441.           pointer position.
  442. DOS Function: 24h
  443. DOS Versions: 1, 2, 3
  444. Input
  445.     FCBSeg - segment address of the File Control Block(FCB)
  446.     FCBOfs - offset of FCB
  447. Output
  448. Registers modified: ah, dx, ds, flags
  449. Syntax: SetFCBFileRecord    FCBSeg, FCBOfs
  450.  
  451. SetVector
  452. ---------
  453. Function: Changes the indicated interrupt vector to the new vector defined in
  454.           VectorSeg:VectorOfs.
  455. DOS Function: 25h
  456. DOS Versions: 1, 2, 3
  457. Input
  458.     Vector - Interrupt vector to modify
  459.     VectorSeg - Segment address of new interrupt handler
  460.     VectorOfs - Offset from VectorSeg of new handler
  461. Output
  462.     none
  463. Registers modified: ax, dx, ds, Flags
  464. Syntax: SetVector   Vector, VectorSeg, VectorOfs
  465.  
  466. CreatePSP
  467. ---------
  468. Function: Creates a new Program Segment Prefix(PSP)
  469. DOS Function: 26h
  470. DOS Versions: 1, 2, 3
  471. Input
  472.     PSPSeg - Segment address of new PSP
  473. Output
  474.     none
  475. Registers modified: ah, dx, flags
  476. Syntax: CreatePSP   PSPSeg
  477.  
  478. RandomFCBBlockRead
  479. ------------------
  480. Function: Does a random read of one or more records from a file opened using an
  481.           FCB.
  482. DOS Function: 27h
  483. DOS Versions: 1, 2, 3
  484. Input
  485.     FCBSeg - segment address of the File Control Block(FCB)
  486.     FCBOfs - offset of FCB
  487.     Count  - Number of records to read
  488. Output
  489.     al - 0 = read successful
  490.          1 = end of file
  491.          2 = segment wrap
  492.          3 = partial record read at eof
  493.     cx - actual # of records read from the file
  494. Registers modified: ax, cx, dx, ds, flags
  495. Syntax: RandomFCBBlockRead  FCBSeg, FCBOfs, Count
  496.  
  497. RandomFCBBlockWrite
  498. -------------------
  499. Function: Performs a random write of the specified number of records to a file
  500.           opened using an FCB.
  501. DOS Function: 28h
  502. DOS Versions: 1, 2, 3
  503. Input
  504.     FCBSeg - segment address of the File Control Block(FCB)
  505.     FCBOfs - offset of FCB
  506.     Count  - Number of records to read
  507. Output
  508.     al - 0 = write successful
  509.          1 = disk full
  510.          2 = segment wrap
  511.     cx - actual # of records written to the file
  512. Registers modified: ax, cx, dx, ds, flags
  513. Syntax: RandomFCBBlockWrite FCBSeg, FCBOfs, Count
  514.  
  515. ParseFCBFilename
  516. ----------------
  517. Function: Parses a string representing a filename and fills in the appropriate
  518.           fields of an FCB.
  519. DOS Function: 29h
  520. DOS Versions: 1, 2, 3
  521. Input
  522.     Flags - Flags that control parsing as defined below
  523.     FLAGS       OPERATION
  524.     ---------------------------------------------------------------------
  525.     Bit 3  = 1  Only if an extension is given in the indicated file spec.
  526.                 will the extension in the FCB will be modified.
  527.            = 0  Replace the FCB's current extension with the one in the
  528.                 file spec. or initialize the FCB to blanks.
  529.     Bit 2  = 1  Only if a filename is given in the indicated file spec.
  530.                 will the filename in the FCB will be modified.
  531.            = 0  Replace the FCB's current filename with the one in the
  532.                 file spec. or initialize the FCB to blanks.
  533.     Bit 1  = 1  Only if a drive is given in the indicated file spec. will
  534.                 the drive in the FCB will be modified.
  535.            = 0  Replace the FCB's current drive with the one in the file
  536.                 spec. or initialize the FCB to blanks.
  537.     Bit 0  = 1  Leading seperators will be ignored.
  538.            = 0  Leading seperators will not be ignored.
  539.     ---------------------------------------------------------------------
  540.     FilenameSeg - Segment address of the string containing the filename
  541.     FilenameOfs - Offset of filename string
  542.     FCBSeg - Segment address of FCB
  543.     FCBOfs - Offset of FCB
  544. Output
  545.     al - 0 = No wildcard characters
  546.          1 = Wildcard characters exist in the filename
  547.        FFh = Specified drive doesn't exist
  548.     ds:si - pointer to first byte position after the filename string
  549.     es:di - pointer to FCB
  550. Registers modified: ax, di, si, ds, es, flags
  551. Syntax: ParseFCBFilename    Flags, FilenameSeg, FilenameOfs, FCBSeg, FCBOfs
  552.  
  553. GetDate
  554. -------
  555. Function: Gets the system date.
  556. DOS Function: 2Ah
  557. DOS Versions: 1, 2, 3
  558. Input
  559.     none
  560. Output
  561.     cx - year(1980 - 2099)
  562.     dh - month(1 - 12)
  563.     dl - day(1 - 31)
  564.     al - day of week(0 = Sunday, 1 = Monday, etc.) - Only on DOS 1.1
  565.          or later
  566. Registers modified: ax, cx, dx, flags
  567. Syntax: GetDate
  568.  
  569. SetDate
  570. -------
  571. Function: Sets the system date.
  572. DOS Function: 2Bh
  573. DOS Versions: 1, 2, 3
  574. Input
  575.     Year - year(1980 - 2099)
  576.     Month - month(1 - 12)
  577.     Day - day(1 - 31)
  578. Output
  579.     al - 0 = success, 0FFh = invalid date
  580. Registers modified: ax, cx, dx, flags
  581. Syntax: SetDate Year, Month, Day
  582.  
  583. GetTime
  584. -------
  585. Function: Gets the system time.
  586. DOS Function: 2Ch
  587. DOS Versions: 1, 2, 3
  588. Input
  589.     none
  590. Output
  591.     ch - hour(0 - 23)
  592.     cl - minutes(0 - 59)
  593.     dh - seconds(0 - 59)
  594.     dl - hundredths of a second(0 - 99)
  595. Registers modified: ah, cx, dx, flags
  596. Syntax: GetTime
  597.  
  598. SetTime
  599. -------
  600. Function: Sets the system time.
  601. DOS Function: 2Dh
  602. DOS Versions: 1, 2, 3
  603. Input
  604.     Hour - hour(0 - 23)
  605.     Minute - minutes(0 - 59)
  606.     Second - seconds(0 - 59)
  607.     Hundredth - hundredths of a second(0 - 99)
  608. Output
  609.     al - 0 = success, 0FFh - invalid time
  610. Registers modified: ah, cx, dx, flags
  611. Syntax: SetTime Hour, Minute, Second, Hundredth
  612.  
  613. SetVerifyFlag
  614. -------------
  615. Function: Sets the system verify flag to on or off.
  616. DOS Function: 2Eh
  617. DOS Versions: 1, 2, 3
  618. Input
  619.     Flag - 0 = Turn off verify flag
  620.          - 1 = Turn the verify flag on
  621. Output
  622.     none
  623. Registers modified: ax, dl, flags
  624. Syntax: SetVerifyFlag   Flag
  625.  
  626. GetDTA
  627. ------
  628. Function: Returns the address of the current DTA.
  629. DOS Function: 2Fh
  630. DOS Versions: 2, 3
  631. Input
  632.     none
  633. Output
  634.     es:bx - Far pointer to DTA
  635. Registers modified: ah, bx, es, Flags
  636. Syntax: GetDTA
  637.  
  638.  
  639. GetDOSVersion
  640. --------------
  641. Function: Returns the DOS version.
  642. DOS Function: 30h
  643. DOS Services: 2, 3
  644. Input
  645.     none
  646. Output
  647.     ax - DOS version
  648. Registers modified: ax, Flags
  649. Syntax: GetDOSVersion
  650.  
  651. TSR
  652. ---
  653. Function: Terminates a program but leaves it resident in memory.
  654. DOS Function: 31h
  655. DOS Versions: 2, 3
  656. Input
  657.     Result - return code
  658.     Paragraphs - # of paragraphs to reserve for the program
  659. Output
  660.     none
  661. Registers modified: ax, dx, flags
  662. Syntax: TSR Result, Paragraphs
  663.  
  664. GetSetBREAK
  665. -----------
  666. Functioni: Sets the CTR_BREAK checking flag. Note that if Mode = 0 you do not
  667.            need to provide the Value parameter.
  668. DOS Function: 33h
  669. DOS Versions: 2, 3
  670. Input
  671.     Mode - 0 = Getting status of the flag
  672.          - 1 = Setting the status of the flag
  673.     Value - 0 = Turn CTRL-BREAK checking off
  674.           - 1 = Turn CTRL-BREAK checking on
  675. Output
  676.     dl - 0 = if CTRL-BREAK checking off
  677.        - 1 = if CTRL-BREAK checking on
  678. Registers modified: ax, dl, flags
  679. Syntax: GetSetBREAK Mode, Value
  680.  
  681. GetVector
  682. ---------
  683. Function: Returns the vector for a specified interrupt.
  684. DOS Function: 35h
  685. DOS Versions: 2, 3
  686. Input
  687.     Interrupt - Which interrupt to return the vector of.
  688. Output
  689.     es:bx - vector for the indicated interrupt
  690. Registers modified: ax, bx, es, flags
  691. Syntax: GetVector   Interrupt
  692.  
  693. GetDiskSpace
  694. ------------
  695. Function: Returns the amount of space available on the specified disk.
  696. DOS Function: 36h
  697. DOS Versions: 2, 3
  698. Input
  699.     Disk - Which disk to check(0 = default, 1 = A, etc.)
  700. Output
  701.     ax - sectors per cluster
  702.        FFFFh - if specified drive doesn't exist
  703.     bx - # of available clusters
  704.     cx - bytes per sector
  705.     dx - clusters per drive
  706. Registers modified: ax, bx, cx, dx, flags
  707. Syntax: GetDiskSpace    Disk
  708.  
  709. GetSetCountryInfo
  710. -----------------
  711. Function: Gets or sets the current country information. Note that you can only
  712.           set the country information if running on DOS version 3.0 or later.
  713.           Note that if ShortCode < 255 then you do not need to provide the
  714.           LongCode parameter. If the LongCode parameter is provided it will be
  715.           loaded into the apprpriate register regardless of the value of
  716.           ShortCode.
  717. DOS Function: 38h
  718. DOS Versions: 2, 3
  719. Input
  720.     BufferSeg - Segment address of the buffer to store the info. in.
  721.     BufferOfs - offset of the storage buffer.
  722.     ShortCode - < 255 = Specific country code < 255
  723.                 0FFh = Country code >= 255 so use LongCode
  724.     LongCode - Country code >= 255
  725. Output
  726.     bx - country code
  727.     ds:dx - pointer to the information buffer
  728. Registers modified: ax, bx, dx, ds, flags
  729. Syntax: GetSetCountryInfo   BufferSeg, BufferOfs, ShortCode, LongCode
  730.  
  731. CreateDir
  732. ---------
  733. Function: Creates a directory using the name pointed to by StringSeg:StringOfs.
  734. DOS Function: 39h
  735. DOS Versions: 2, 3
  736. Input
  737.     StringSeg - Segment address of string containing directory name
  738.     StringOfs - Offset from StringSeg of directory name
  739. Output
  740.     If function successful:
  741.         Carry flag - clear
  742.     If function failed
  743.         Carry flag - set
  744.         ax - error code:
  745.             3 - Path not found
  746.             5 - Access denied
  747. Registers modified: ax, dx, ds, Flags
  748. Syntax: CreateDir   StringSeg, StringOfs
  749.  
  750. RemoveDir
  751. ---------
  752. Function: Macro deletes the indicated directory.
  753. DOS Function: 3Ah
  754. DOS Versions: 2, 3
  755. Input
  756.     StringSeg - Segment address of string containing directory name
  757.     StringOfs - Offset from StringSeg of directory name
  758. Output
  759.     If function successful:
  760.         Carry flag - clear
  761.     If function failed
  762.         Carry flag - set
  763.         ax - error code:
  764.             3 - Path not found
  765.             5 - Access denied
  766.             6 - Current directory
  767.           16d - Current directory
  768. Registers modified: ax, dx, ds, Flags
  769. Syntax: RemoveDir   StringSeg, StringOfs
  770.  
  771. ChangeDirectory
  772. ---------------
  773. Function: Sets the current directory to the directory pointed to by
  774.           StringSeg:StringOfs.
  775. DOS Function: 3Bh
  776. DOS Versions: 2, 3
  777. Input
  778.     StringSeg - segment address of ASCIIZ string
  779.     StringOfs - offset within StringSeg of directory name
  780. Output
  781.     If function successful:
  782.         Carry flag - clear
  783.     If function failed
  784.         Carry flag - set
  785.         ax = error code:
  786.             3 - Path not found
  787. Registers modified: ax, dx, ds, Flags
  788. Syntax: ChangeDirectory StringSeg, StringOfs
  789.  
  790. CreateFile
  791. ----------
  792. Function: Creates a new file or truncates an existing file to 0 bytes. A file
  793.           associated with the file is returned.
  794. DOS Function: 3Ch
  795. DOS Versions: 2, 3
  796. Input
  797.     Attributes - File's attributes
  798.     StringSeg - Segment address of ASCIIZ file spec.
  799.     StringOfs - Offset within StringSeg of file spec.
  800. Output
  801.     If function successful:
  802.         Carry flag - clear
  803.         ax - file handle
  804.     If function failed
  805.         Carry flag - set
  806.         ax - error code:
  807.             3 - Path not found
  808.             4 - No handle available
  809.             5 - Access denied
  810. Registers modified: ax, cx, dx, ds, Flags
  811. Syntax: CreateFile  Attributes, StringSeg, StringOfs
  812.  
  813. OpenFile
  814. --------
  815. Function: Opens an exiting file and returns a file handle associated with the
  816.           file.
  817. DOS Function: 3Dh
  818. DOS Versions: 2, 3
  819. Input
  820.     AccessMode - File access mode as defined below
  821.     BITS    VALUE       FUNCTION                        DOS VERSION
  822.     ----    -----       ----------------------------    -----------
  823.      0-2     000        Read Access                      2.0 & 3.0
  824.              001        Write Access                     2.0 & 3.0
  825.              010        Read/Write Access                2.0 & 3.0
  826.        3       0        Reserved
  827.      4-6     000        Sharing mode, compatability mode       3.0
  828.              001        Sharing mode, read/write access        3.0
  829.                         denied
  830.              010        Sharing mode, Write access denied      3.0
  831.              011        Sharing mode, Read access denied       3.0
  832.              100        Sharing mode, Full access permitted    3.0
  833.        7       0        Inheritance flag, File inherited       3.0
  834.                         by child processes
  835.                1        Inheritance flag, File private to      3.0
  836.                         current process
  837.     ---------------------------------------------------------------
  838.     StringSeg - Segment address of ASCIIZ file spec.
  839.     StringOfs - Offset within StringSeg of file spec.
  840. Output
  841.     If function successful:
  842.         Carry flag - clear
  843.         ax - file handle
  844.     If function failed
  845.         Carry flag - set
  846.         ax - error code:
  847.             1 - Function number invalid
  848.             2 - File not found
  849.             3 - Path not found or file doesn't exist
  850.             4 - No handle available
  851.             5 - Access denied
  852.           OCH - File access code invalid
  853. Registers modified: ax, dx, ds, Flags
  854. Syntax: OpenFile  AccessMode, StringSeg, StringOfs
  855.  
  856. CloseFile
  857. ---------
  858. Function: Closes a file associated with a file handle.
  859. DOS Function: 3Eh
  860. DOS Versions: 2, 3
  861. Input
  862.     Handle - File handle of file to close
  863. Output
  864.     If function successful:
  865.         Carry flag - clear
  866.     If function failed:
  867.         Carry flag - set
  868.         ax - error code:
  869.             6 - handle invalid or not open
  870. Registers modified: ax, bx, Flags
  871. Syntax: CloseFile   Handle
  872.  
  873. ReadFile
  874. --------
  875. Function: Reads Count bytes from the file referenced by the file handle.
  876. DOS Function: 3Fh
  877. DOS Versions: 2, 3
  878. Input
  879.     Handle - DOS file handle of file to read from
  880.     Count - # of bytes to read
  881.     StringSeg - Segment address of buffer to store data in
  882.     StringOfs - offset within StringSeg of storage buffer
  883. Output
  884.     If function successful:
  885.         Carry flag - clear
  886.         ax - # of bytes read(0 if EOF)
  887.     If function failed
  888.         Carry flag - set
  889.         ax - error code:
  890.             5 - Access denied
  891.             6 - Invalid handle or file not open
  892. Registers modified: ax, bx, cx, ds, Flags
  893. Syntax: ReadFile    Handle, Count, StringSeg, StringOfs
  894.  
  895. WriteFile
  896. ---------
  897. Function: Writes Count bytes to the file referenced by the file handle.
  898. DOS Function: 40h
  899. DOS Versions: 2, 3
  900. Input
  901.     Handle - DOS file handle of file to write to
  902.     Count - # of bytes to write
  903.     StringSeg - Segment address of buffer storing data
  904.     StringOfs - offset within StringSeg of storage buffer
  905. Output
  906.     If function successful:
  907.         Carry flag - clear
  908.         ax - # of bytes read(0 if disk full)
  909.     If function failed
  910.         Carry flag - set
  911.         ax - error code:
  912.             5 - Access denied
  913.             6 - Invalid handle or file not open
  914. Registers modified: ax, bx, cx, ds, Flags
  915. Syntax: WriteFile    Handle, Count, StringSeg, StringOfs
  916.  
  917. DeleteFile
  918. ----------
  919. Function: Deletes the file pointed to by StringSeg:StringOfs.
  920. DOS Function: 41h
  921. DOS Versions: 2, 3
  922. Input
  923.     StringSeg - segment address of the filename
  924.     StringOfs - offset from StringSeg of the filename
  925. Output
  926.     If function successful:
  927.         Carry flag - clear
  928.     If function failed
  929.         Carry flag - set
  930.         ax - error code:
  931.             2 - File not found
  932.             5 - Access denied
  933. Registers modified: ax, dx, ds, Flags
  934. Syntax: DeleteFile  StringSeg, StringOfs
  935.  
  936. MoveFilePtr
  937. -----------
  938. Function: Positions the file pointer in the file referenced by Handle.
  939. DOS Function: 42h
  940. DOS Versions: 2, 3
  941. Input
  942.     Mode - Offset method as define below
  943.     MODE    FUNCTION
  944.     ----    -----------------------------------------------------------
  945.       0     absolute byte offset from beginning of file(always unsigned
  946.             long integer)
  947.       1     byte offset from current location(signed long integer)
  948.       2     byte offset from end of file(signed long integer)
  949.     -------------------------------------------------------------------
  950.     Handle - File handle
  951.     OffsetHigh - Most significant word of offset
  952.     OffsetLow  - Least significant word of offset
  953. Output
  954.     If function successful:
  955.         Carry flag - clear
  956.         dx - most significant word of new pointer
  957.         ax - least significant word of new pointer
  958.     If function failed
  959.         Carry flag - set
  960.         ax - error code:
  961.             1 - Function number invalid
  962.             6 - Handle invalid or not open
  963. Registers modified: ax, bx, cx, dx, Flags
  964. Syntax: MoveFilePtr Mode, Handle, OffsetHigh, OffsetLow
  965.  
  966. GetSetAttributes
  967. ----------------
  968. Function: Gets or sets the file attributes.
  969. DOS Function: 43h
  970. DOS Versions: 2, 3
  971. Input
  972.     Mode
  973.         0 - Get file attributes
  974.         1 - Set file attributes
  975.     Attributes - New attributes or location to store file's current
  976.                  attributes.
  977.     StringSeg - Segment address of the filename to check/modify
  978.     StringOfs - Offset within StringSeg of the filename
  979. Output
  980.     If function successful:
  981.         Carry flag - clear
  982.         If al = 0 on call
  983.             cx - attribute
  984.     If function failed:
  985.         Carry flag - set
  986.         ax - error code:
  987.             1 - Function code invalid
  988.             2 - File not found
  989.             3 - Path not found or file doesn't exist
  990.             5 - Attribute can't be changed
  991. Registers modified: ax, cx, dx, ds, Flags
  992. Syntax: GetSetAttributes    Mode, Attributes, StringSeg, StringOfs
  993.  
  994. IOCTL
  995. -----
  996. Function: Passes control information to a device driver. Note that you must
  997.           provide either the buffer address parameters or the device
  998.           information parameter but not both.
  999. DOS Function: 44h
  1000. DOS Versions: 2, 3
  1001. Input
  1002.     Function - What to do as defined below:
  1003.     FUNCTION    RESULT
  1004.     -----------------------------------------------------------------------
  1005.         00h     Get device information
  1006.         01h     Set device information
  1007.         02h     Read from character device control channel to a buffer
  1008.         03h     Write to a character device control channel from a buffer
  1009.         04h     Read from block device control channel to a buffer
  1010.         05h     Write to a block device control channel from a buffer
  1011.         06h     Get the input status
  1012.         07h     Get output status
  1013.         08h     Check whether a block device is changable(DOS 3.0)
  1014.         09h     Check whether a drive is local or remote(DOS 3.1 &
  1015.                 Microsoft Networks)
  1016.         0Ah     Check whether a handle is local or remote(DOS 3.1 &
  1017.                 Microsoft Networks)
  1018.         0Bh     Change the sharing retry count
  1019.     -----------------------------------------------------------------------
  1020.     HandleDrive - Handle(functions 0, 1, 2, 3, 6, 7, 0Ah)
  1021.                 - Drive(0 = default, 1 = A, etc.)
  1022.     Count - # of bytes to read/write
  1023.     BufSegDevInfo - Represents Segment address of the input/output
  1024.                     buffer(functions 2-5)
  1025.                   - Represents device information(function 1).
  1026.     BufferOfs - offset of the storage buffer(functions 2-5)
  1027. Output
  1028.     Carry flag = clear  - operation successful
  1029.         ax - # of bytes read/written(functions 2-5)
  1030.         al - 0 = not ready(functions 6-7)
  1031.            - 1 = ready
  1032.         ax - 0 = removable(function 8)
  1033.            - 1 = fixed
  1034.         dx - Device information(function 0)
  1035.     Carry flag = set
  1036.         ax - error code
  1037.            1 = Invalid function number
  1038.            4 = No handle available
  1039.            5 = Access denied
  1040.            6 = Invalid handle or device not open
  1041.          0Dh = Invalid data
  1042.          0Fh = Invalid drive number
  1043. Registers modified: ax, bx, cx, dx, ds, flags
  1044. Syntax: IOCTL   Function, HandleDrive, Count, BufSegDevInfo, BufferOfs
  1045.  
  1046. DuplicateHandle
  1047. ---------------
  1048. Function: Duplicates a file handle that is associated with an open file or
  1049.           device.
  1050. DOS Function: 45h
  1051. DOS Versions: 2, 3
  1052. Input
  1053.     Handle - the handle to duplicate
  1054. Output
  1055.     carry flag = clear
  1056.         ax - new file handle
  1057.     carry flag = set
  1058.         ax - error code
  1059.            4 = No more file handles available
  1060.            6 = Invalid handle or file not open
  1061. Registers modified: ax, bx, flags
  1062. Syntax: DuplicateHandle Handle
  1063.  
  1064. ForceDupHandle
  1065. --------------
  1066. Function: Takes two file handles and makes the second one equal to the first.
  1067. DOS Function: 46h
  1068. DOS Versions: 2, 3
  1069. Input
  1070.     Original - Original file handle
  1071.     Copy     - Copy of the file handle
  1072. Output
  1073.     carry flag = clear - operation successful
  1074.     carry flag = set
  1075.         ax - error code
  1076.            4 = No more file handles available
  1077.            6 = Invalid handle or file not open
  1078. Registers modified: ax, bx, cx, flags
  1079. Syntax: ForceDupHandle  OriginalHandle, HandleCopy
  1080.  
  1081. GetCurrentDir
  1082. -------------
  1083. Function: Returns the current DOS directory on the indicated disk drive.
  1084. DOS Function: 47h
  1085. DOS Versions: 2, 3
  1086. Input
  1087.     Drive - Disk drive(0 = default, 1 = A, etc.)
  1088.     StringSeg - Segment address of 64-byte buffer to store directory
  1089.                 name in
  1090.     StringOfs - Offset within StringSeg of the 64-byte buffer
  1091. Output
  1092.     If function successful:
  1093.         Carry flag - clear
  1094.         The buffer is filled with the full path
  1095.     If function failed
  1096.         Carry flag - set
  1097.         ax - error code:
  1098.           0Fh - Invalid drive specification
  1099. Registers modified: ax, dl, si, ds, Flags
  1100. Syntax: GetCurrentDir   Drive, StringSeg, StringOfs
  1101.  
  1102. AllocateMemory
  1103. --------------
  1104. Function: Allocates Paragraphs paragraphs of memory.
  1105. DOS Function: 48h
  1106. DOS Versions: 2, 3
  1107. Input
  1108.     Paragraphs - # of paragraphs to allocate
  1109. Output
  1110.     If function successful:
  1111.         Carry flag - clear
  1112.         ax - initial segment of allocated block
  1113.     If function failed:
  1114.         Carry flag - set
  1115.         ax - error code:
  1116.             7 - If memory control blocks destroyed
  1117.             8 - If insufficient memory
  1118.         bx - size of largest block available
  1119. Registers modified: ax, bx, Flags
  1120. Syntax: AllocateMemory  Paragraphs
  1121.  
  1122. FreeMemory
  1123. ----------
  1124. Function: Frees a DOS memory block.
  1125. DOS Function: 49h
  1126. DOS Versions: 2, 3
  1127. Input
  1128.     BlockAddress - segment address of the memory block
  1129. Output
  1130.     If function successful:
  1131.         Carry flag - clear
  1132.     If function failed:
  1133.         Carry flag - set
  1134.         ax - error code:
  1135.             7 - If memory control blocks destroyed
  1136.             8 - If insufficient memory
  1137.         bx - size of largest block available
  1138. Registers modified: ax, es, Flags
  1139. Syntax: FreeMemory  BlockAddress
  1140.  
  1141. ModifyMemory
  1142. ------------
  1143. Function: Modifies A DOS memory blocks size.
  1144. DOS Function: 4Ah
  1145. DOS Versions: 2, 3
  1146. Input
  1147.     Size - New block size in paragraphs
  1148.     MemoryBlock - Segment address of current DOS memory block
  1149. Output
  1150.     If function successful:
  1151.         Carry flag - clear
  1152.     If function failed
  1153.         Carry flag - set
  1154.         ax - error code:
  1155.             7 - Memory control blocks destroyed
  1156.             8 - Insufficient memory
  1157.             9 - Incorrect segment in es
  1158.         bx - maximum block size available
  1159. Registers modified: ax, bx, es, Flags
  1160. Syntax: ModifyMemory    Size, MemoryBlock
  1161.  
  1162. Exec
  1163. ----
  1164. Function: Runs another program or loads an overlay into memory.
  1165. DOS Function: 4Bh
  1166. DOS Versions: 2, 3
  1167. InputSyntax
  1168.     Type - Indicates if the macro is running an application or loading an
  1169.            overlay
  1170.     ParmSeg - Segment address of parameter block
  1171.     ParmOfs - Offset of parameter block
  1172.     ProgramSeg - Segment address of program specification
  1173.     ProgramOfs - Offset of program specification
  1174. Output
  1175.     carry flag = clear - operation successful
  1176.         all registers except cs and ip are destroyed
  1177.     carry flag = set - operation not successful
  1178.         ax - error code
  1179.            1 = Invalid function
  1180.            2 = Program not found
  1181.            5 = Access denied
  1182.            8 = Insufficient memory to run the program
  1183.          0Ah = Invalid environment
  1184.          0Bh = Invalid format
  1185. Registers modified: ax, bx, cx, dx, si, di, bp, sp, es, ds, ss, flags
  1186. Syntax: Exec    Type, ParmSeg, ParmOfs, ProgramSeg, ProgramOfs
  1187.  
  1188. TerminateProgram
  1189. ----------------
  1190. Function: Terminates the program. If running on DOS 1.0 or 1.1 use
  1191.           Terminate10Program.
  1192. DOS Function: 4Ch
  1193. DOS Versions: 2, 3
  1194. Input
  1195.     ErrorLevel - ErrorLevel to return to DOS
  1196. Output
  1197.     None
  1198. Register modified
  1199.     NA
  1200. Syntax
  1201.     TerminateProgram    ErrorLevel
  1202.  
  1203. GetReturnCode
  1204. -------------
  1205. Function: Gets the return code after an Exec.
  1206. DOS Function: 4Dh
  1207. DOS Versions: 2, 3
  1208. Input
  1209.     none
  1210. Output
  1211.     ah  - exit type
  1212.         0 = normal program termination
  1213.         1 = program was terminated by a CTRL-C
  1214.         2 = A critical device error terminated the program
  1215.         3 = Function 31h terminated the program
  1216.     al - return code of child process
  1217. Registers modified: ax, flags
  1218. Syntax: GetReturnCode
  1219.  
  1220. FindFirst
  1221. ---------
  1222. Function: Finds the first entry in a directory that matches the given file
  1223.           specification. The information about the file is then stored in the
  1224.           current DTA.
  1225. DOS Function: 4Eh
  1226. DOS Services: 2, 3
  1227. Input
  1228.     Attributes - Attributes to use in search for file
  1229.     StringSeg - segment address of the filename
  1230.     StringOfs - offset from StringSeg of the filename
  1231. Output
  1232.     If function successful:
  1233.         Carry flag - clear
  1234.         DTA is initialized with file information
  1235.     If function failed
  1236.         Carry flag - set
  1237.         ax - error code:
  1238.             2 - Invalid path
  1239.           12h - No matching entry found
  1240. Registers modified: ax, cx, dx, ds, Flags
  1241. Syntax: FindFirst   Attributes, StringSeg, StringOfs
  1242.  
  1243. FindNext
  1244. -------
  1245. Function: Finds the next entry in a directory that matches the file
  1246.           specification last given to FindNext. The information about the file
  1247.           is then stored in the current DTA.
  1248. DOS Function: 4Fh
  1249. DOS Services: 2, 3
  1250. Input
  1251.     none
  1252. Output
  1253.     If function successful:
  1254.         Carry flag - clear
  1255.         DTA is initialized with file information
  1256.     If function failed
  1257.         Carry flag - set
  1258.         ax - error code:
  1259.           12h - No matching entry found
  1260. Registers modified: ax, Flags
  1261. Syntax: FindNext
  1262.  
  1263. GetVerifyFlag
  1264. -------------
  1265. Function: Gets the current value of the system's verify flag.
  1266. DOS Function: 54h
  1267. DOS Versions: 2, 3
  1268. Input
  1269.     none
  1270. Output
  1271.     al  - current value
  1272.         0 = verify off
  1273.         1 = verify on
  1274. Registers modified: ax, flags
  1275. Syntax: GetVerifyFlag
  1276.  
  1277. RenameFile
  1278. ----------
  1279. Function: Renames a file.
  1280. DOS Function: 56h
  1281. DOS Versions: 2, 3
  1282. Input
  1283.     OrigSeg - Segment address of the string containing the original filename
  1284.     OrigOfs - Offset of the string
  1285.     NewSeg  - Segment address of the new filename
  1286.     NewOfs  - Offset of the new filename string
  1287. Output
  1288.     carry flag = clear - operation successful
  1289.     carry flag = set - operation unsuccessful
  1290.         ax - error code
  1291.             2 = File not found
  1292.             3 = File couldn't be found
  1293.             5 = Access denied
  1294.           11h = A different device
  1295. Registers modified: ax, dx, di, ds, es, flags
  1296. Syntax: RenameFile  OrigSeg, OrigOfs, NewSeg, NewOfs
  1297.  
  1298. GetSetFileDateTime
  1299. ------------------
  1300. Function: Will get or set a file's date and time. Note that you only need to
  1301.           provide the Time and Date parameters when setting the file's Date and
  1302.           Time.
  1303. DOS Function: 57h
  1304. DOS Versions: 2, 3
  1305. Input
  1306.     GetSet - 0 = Get the file's date & time, 1 = Set them
  1307.     Handle - File handle
  1308.     Time - New time(GetSet = 1)
  1309.     Date - New date(GetSet = 1)
  1310. Output
  1311.     carry flag = clear - operation successful
  1312.     carry flag = set - operation unsuccessful
  1313.         ax - error code
  1314.             1 - Invalid function
  1315.             6 - Invalid file handle
  1316. Registers modified: ax, bx, cx, dx, flags
  1317. Syntax: GetSetFileDateTime  GetSet, Handle, Time, Date
  1318.  
  1319. GetSetAllocationStrategy
  1320. ------------------------
  1321. Function: Gets or sets DOS's memory allocation strategy.
  1322. DOS Function: 58h
  1323. DOS Versions: 3
  1324. Input
  1325.     GetSet - 0 = get, 1 = set
  1326.     Strategy - Code as defined below(GetSet = 1)
  1327.     STRATEGY        FUNCTION
  1328.     ------------------------------
  1329.         0           First fit
  1330.         1           Best fit
  1331.         2           Last fit
  1332. Output
  1333.     carry flag = clear - operation successful
  1334.     carry flag = set - operation unsuccessful
  1335.         ax - error code
  1336.             1 = Invalid function
  1337. Registers modified: ax, bx, flags
  1338. Syntax: GetSetAllocationStrategy
  1339.  
  1340. GetExtendedErrors
  1341. -----------------
  1342. Function: Returns extended error information about a DOS error that just
  1343.           occurrred.
  1344. DOS Function: 59h
  1345. DOS Versions: 3
  1346. Input
  1347.     none
  1348. Output
  1349.     ax - extended error code as define below
  1350.     CODE    DESCRIPTION
  1351.     ----------------------------------------------------
  1352.      1      Invalid function #
  1353.      2      File not found
  1354.      3      Path not found
  1355.      4      Too many open files
  1356.      5      Access denied
  1357.      6      Invalid handle
  1358.      7      Memory control blocks destroyed
  1359.      8      Insufficient memory
  1360.      9      Memory block address invalid
  1361.     0Ah     Environment invalid
  1362.     0Bh     Invalid format
  1363.     0Ch     Invalid access code
  1364.     0Dh     Invalid data
  1365.     0Fh     Invalid disk drive
  1366.     10h     Attempted to delete the current directory
  1367.     11h     Not the same device
  1368.     12h     No more files
  1369.     13h     Disk is write-protected
  1370.     14h     Unit unknown
  1371.     15h     Drive not ready
  1372.     16h     Unknown command
  1373.     17h     Data error(CRC value)
  1374.     18h     Bad request structure length
  1375.     19h     Seek error
  1376.     1Ah     Unknown medium type
  1377.     1Bh     Sector not found
  1378.     1Ch     Printer out of paper
  1379.     1Dh     Write fault
  1380.     1Eh     Read fault
  1381.     1Fh     General failure
  1382.     20h     Sharing violation
  1383.     21h     Lock violation
  1384.     22h     Disk change invalid
  1385.     23h     FCB unavailable
  1386.     50h     File already exists
  1387.     52h     Cannot create the directory
  1388.     53h     Int-24(critical error) failed
  1389.     --------------------------------------------------------
  1390. bh - error class as defined below
  1391.     CLASS   DESCRIPTION
  1392.     --------------------------------------------------------
  1393.     1       Out of a resource
  1394.     2       A temporary situation like a locked record
  1395.     3       Authorization error
  1396.     4       Internal system error
  1397.     5       Hardware failure
  1398.     6       System software failure
  1399.     7       Application software error
  1400.     8       File or item not found
  1401.     9       Invaalid format or type for file or item
  1402.     0Ah     File or item is interlocked
  1403.     0Bh     Wrong disk or bad disk
  1404.     0Ch     Any other error
  1405.     --------------------------------------------------------
  1406. bl - recommended action as defined below
  1407.     ACTION  DESCRIPTION
  1408.     ---------------------------------------------------------------
  1409.     1       Retry the operation a few times then prompt the user
  1410.     2       Retry the operation with a small delay between retries,
  1411.             then prompt the user.
  1412.     3       Get input from user
  1413.     4       Abort the application gracefully
  1414.     5       Abort immediately
  1415.     6       Ignore the error
  1416.     7       Retry the operation after the user corrects the problem
  1417.     ----------------------------------------------------------------
  1418. ch - location of the error as defined below
  1419.     LOCATION    DESCRIPTION
  1420.     ----------------------------------------------------------------
  1421.         1       Unknown
  1422.         2       A block device like a disk or ram disk
  1423.         3       Network related error
  1424.         4       Serial device error
  1425.         5       Memory related error
  1426.     ----------------------------------------------------------------
  1427. Registers modified: ax, bx, cx, flags
  1428. Syntax: GetExtendedErrors
  1429.  
  1430. CreateTemporaryFile
  1431. -------------------
  1432. Function: Creates a temporary file.
  1433. DOS Function: 5Ah
  1434. DOS Versions: 3
  1435. Input
  1436.     Attribute - File attribute as defined below
  1437.     ATTRIBUTE   DESCRIPTION
  1438.     -------------------------------------------
  1439.         0       Normal file
  1440.         1       Read-only
  1441.         2       Hidden
  1442.         4       System
  1443.     -------------------------------------------
  1444.     FilenameSeg - Segment address of filename string
  1445.     FilenameOfs - Offset of filename string
  1446. Output
  1447.     carry flag = clear - operation successful
  1448.         ax - file handle
  1449.         ds:dx - address of the filename string
  1450.     carry flag = set - operation unsuccessful
  1451.         ax - error code
  1452.             3 = Path not found
  1453.             5 = Access denied
  1454. Registers modified: ax, dx, ds, flags
  1455. Syntax: CreateTemporaryFile Attribute, FilenameSeg, FilenameOfs
  1456.  
  1457. CreateNewFile
  1458. -------------
  1459. Function: Creates a new file. If the specified file already exists an error is
  1460.           returned.
  1461. DOS Function: 5Bh
  1462. DOS Versions: 3
  1463. Input
  1464.     Attribute - File attribute as defined below
  1465.     ATTRIBUTE   DESCRIPTION
  1466.     -------------------------------------------
  1467.         0       Normal file
  1468.         1       Read-only
  1469.         2       Hidden
  1470.         4       System
  1471.     -------------------------------------------
  1472.     FilenameSeg - Segment address of filename string
  1473.     FilenameOfs - Offset of filename string
  1474. Output
  1475.     carry flag = clear - operation successful
  1476.         ax - file handle
  1477.     carry flag = set - operation unsuccessful
  1478.         ax - error code
  1479.             3 = Path not found
  1480.             4 = No more file handles
  1481.             5 = Access denied
  1482.           50h = File already exists
  1483. Registers modified: ax, cx, dx, ds, flags
  1484. Syntax: CreateNewFile   Attribute, FilenameSeg, FilenameOfs
  1485.  
  1486. ControlFileAccess
  1487. -----------------
  1488. Function: Locks or unlocks a record in a file on a newtorked system.
  1489. DOS Function: 5Ch
  1490. DOS Versions: 3
  1491. Input
  1492.     LockUnlock  - 0 = lock, 1 = unlock
  1493.     Handle - File handle
  1494.     OffsetHigh - High word of record offset
  1495.     OffsetLow - Low word of record offset
  1496.     LengthHigh - High word of record length
  1497.     LengthLow - Low word of record length
  1498. Output
  1499.     carry flag = cleared - operation successful
  1500.     carry flag = set - operation unsuccessful
  1501.         ax - error code
  1502.             1 = Invalid function
  1503.             6 = Invalid file handle
  1504.           21h = All or part of the record is already locked
  1505. Registers modified: ax, bx, cx, dx, si, di, flags
  1506. Syntax: ControlFileAccess   LockUnlock, Handle, OffsetHigh, OffsetLow, LengthHigh, LengthLow
  1507.  
  1508. GetMachineName
  1509. --------------
  1510. Function: Returns the local machine name on a network.
  1511. DOS Function: 5Eh   Sub-Function: 00h
  1512. DOS Versions: 3
  1513. Input
  1514.     BufferSeg - Segment address of the string buffer
  1515.     BufferOfs - Offset of the buffer
  1516. Output
  1517.     carry flag = clear - operation successful
  1518.         ch = 0 - name not defined
  1519.             > 0 - name defined
  1520.         cl - NETBIOS name number(ch <> 0)
  1521.         ds:dx - address of identifier(ch <> 0)
  1522.     carry flag = set - operation unsuccessful
  1523.         ax - error code
  1524.             1 - Invalid function code
  1525. Registers modified: ax, cx, dx, ds, flags
  1526. Syntax: GetMachineName  BufferSeg, BufferOfs
  1527.  
  1528. SetupPrinter
  1529. ------------
  1530. Function: Sets up a printer attached to the network.
  1531. DOS Function: 5Eh   Sub-Function: 02h
  1532. DOS Versions: 3
  1533. Input
  1534.     BufferSeg - Segment address of the setup string
  1535.     BufferOfs - Offset of the buffer
  1536.     ListIndex - Redirection list index
  1537.     StrLength - Length of the setup string
  1538. Output
  1539.     carry flag = clear - operation successful
  1540.     carry flag = set - operation unsuccessful
  1541.         ax - error code
  1542.             1 - Invalid function code
  1543. Registers modified: ax, bx, cx, si, ds, flags
  1544. Syntax: SetupPrinter    BufferSeg, BufferOfs, ListIndex, StrLength
  1545.  
  1546. GetPrinterSetup
  1547. ---------------
  1548. Function: Returns the local machine name on a network.
  1549. DOS Function: 5Eh   Sub-Function: 03h
  1550. DOS Versions: 3
  1551. Input
  1552.     BufferSeg - Segment address of the string buffer
  1553.     BufferOfs - Offset of the buffer
  1554.     Listindex - Redirection list index(Function = 2-3)
  1555. Output
  1556.     carry flag = clear - operation successful
  1557.         cx - length of the printer setup string
  1558.         es:di - address of the buffer holding the setup string
  1559.     carry flag = set - operation unsuccessful
  1560.         ax - error code
  1561.             1 - Invalid function code
  1562. Registers modified: ax, bx, cx, di, es, flags
  1563. Syntax: GetPrinterSetup BufferSeg, BufferOfs, ListIndex
  1564.  
  1565. GetListEntry
  1566. ------------
  1567. Function: Gets a redirection list entry from the network system.
  1568. DOS Function: 5Fh       Sub-function: 02h
  1569. DOS Versions: 3
  1570. Input
  1571.     ListIndex - Redirection list index
  1572.     DeviceSeg - Segment address of buffer to hold the device name
  1573.     DeviceOfs - Offset of buffer
  1574.     NetworkSeg - Segment address of buffer to hold the network's name
  1575.     NetworkOfs - Offset of buffer
  1576. Output
  1577.     carry flag = clear - operation successful
  1578.         bh - device status flag(0 = valid device, 1 = invalid device)
  1579.         bl - Device type(3 = printer, 4 = drive)
  1580.         cx - Stored parameter
  1581.         ds:si - address of device name
  1582.         es:di - address of the network's name
  1583.     carry flag = set - operation unsuccessful
  1584.         ax - error code
  1585.             1 = Invalid function
  1586.           12h = No more files
  1587. Registers modified: ax, bx, cx, dx, bp, si, di, es, ds, flags
  1588. Syntax: GetListEntry    ListIndex, DeviceSeg, DeviceOfs, NetworkSeg, NetworkOfs
  1589.  
  1590. GetListEntry
  1591. ------------
  1592. Function: Redirects a device on a network.
  1593. DOS Function: 5Fh       Sub-function: 03h
  1594. DOS Versions: 3
  1595. Input
  1596.     Type - The device type as defined below
  1597.     TYPE    DESCRIPTION
  1598.     ------------------------------------------
  1599.     3       Printer
  1600.     4       Disk drive
  1601.     ------------------------------------------
  1602.     Save - A parameter that needs to be saved for the caller
  1603.     DeviceSeg - Segment address of buffer to hold the device name
  1604.     DeviceOfs - Offset of buffer
  1605.     NetworkSeg - Segment address of buffer to hold the network's name
  1606.     NetworkOfs - Offset of buffer
  1607. Output
  1608.     carry flag = clear - operation successful
  1609.     carry flag = set - operation unsuccessful
  1610.         ax - error code
  1611.             1 = Invalid function
  1612.             3 = Path not found
  1613.             5 = Access denied
  1614.             8 - Insufficient memory
  1615. Registers modified: ax, bx, cx, si, di, es, ds, flags
  1616. Syntax: GetListEntry    Type, Save, DeviceSeg, DeviceOfs, NetworkSeg, NetworkOfs
  1617.  
  1618. GetListEntry
  1619. ------------
  1620. Function: Redirects a device on a network.
  1621. DOS Function: 5Fh       Sub-function: 04h
  1622. DOS Versions: 3
  1623. Input
  1624.     DeviceSeg - Segment address of buffer to hold the device name
  1625.     DeviceOfs - Offset of buffer
  1626. Output
  1627.     carry flag = clear - operation successful
  1628.     carry flag = set - operation unsuccessful
  1629.         ax - error code
  1630.             1 = Invalid function
  1631.           0Fh - Redirection paused on server
  1632. Registers modified: ax, si, ds, flags
  1633. Syntax: GetListEntry    DeviceSeg, DeviceOfs
  1634.  
  1635. GetPSPAddress
  1636. -------------
  1637. Function: Returns the address of the current PSP.
  1638. DOS Function: 62h
  1639. DOS Versions: 3
  1640. Input
  1641.     none
  1642. Output
  1643.     bx - Segment address of the Program Segment Prefix(PSP)
  1644. Registers modified: ah, bx, flags
  1645. Syntax: GetPSPAddress
  1646.  
  1647. LeadByteTable
  1648. -------------
  1649. Function: Returns the address of the system table of legal lead bytes or
  1650.           gets/sets the value of the interim console flag.
  1651. DOS Function: 63h
  1652. DOS Versions: 2.25
  1653. Input
  1654.     Function - The sub-function as defined below:
  1655.     FUNCTION    DESCRIPTION
  1656.     -----------------------------------------------------------------
  1657.         0       Get the address of the system lead byte table
  1658.         1       Setting the value of the console flag
  1659.         2       Getting the value of the console flag
  1660.     -----------------------------------------------------------------
  1661.     Console - Indicate if setting/getting the console flag(Function = 1)
  1662. Output
  1663.     ds:si - Address of the lead byte table(Function = 0)
  1664.     dl - Value of the console flag(Function = 2)
  1665. Registers modified: ax, dl, flags
  1666. Syntax: LeadByteTable   Function, Console
  1667.