📄 dosmac.doc
字号:
FILENAME: DOSMAC.DOC
DESCRIPTION: This file documents the macros implemented in the files IDOS.MAC
and MDOS.MAC. Note that the only difference between the two macro files is that
IDOS.MAC uses TASM's Ideal mode while MDOS.MAC uses TASM's Masm mode.
Terminate10Program
------------------
Function: Terminate a program without returning an errorlevel to DOS.
DOS Function: 00h
DOS Versions: 1, 2, 3
Input
cs - segment address of Program Segment Prefix(PSP)
Output
none
Registers modified: ah, flags
Syntax: Terminate10Program
ReadKBDEcho
-----------
Function: Reads a character from the keyboard or standard input device and
echoes it to the display. If a character isn't immediately available,
the DOS function waits for one.
DOS Function: 01h
DOS Versions: 1, 2, 3
Input
none
Output
al - character Registers modified: , flags
Syntax: ReadKBDEcho
CharacterOutput
---------------
Function: Outputs a character to the standard output device or to the active
video display.
DOS Function: 02h
DOS Versions: 1, 2, 3
Input
Character - byte value representing character to display
Output
none
Registers modified: ah, dl, flags
Syntax: CharacterOutput Character
AuxiliaryInput
--------------
Function: Reads the next character from the auxiliary input device.
DOS Function: 03h
DOS Versions: 1, 2, 3
Input
none
Output
al - byte value representing the character received
Registers modified: ax, flags
Syntax: AuxiliaryInput
AuxiliaryOutput
---------------
Function: Displays a character to the auxiliary output device.
DOS Function: 04h
DOS Versions: 1, 2, 3
Input
Character - byte value representing character to display
Output
none
Registers modified: ax, dl, flags
Syntax: AuxiliaryOutput
PrinterOutput
-------------
Function: Sends a character to the printer device.
DOS Function: 05h
DOS Versions: 1, 2, 3
Input
Character - value to send to the printer.
Output
none
Registers modified: ah, dl, flags
Syntax: PrinterOutput Character
ConsoleIO
---------
Function: Performs input/output from/to the console device.
DOS Function: 06h
DOS Versions: 1, 2, 3
Input
Function - Desired operation as defined below
Value Behavior
---------------------------------------------------
0-0FEh Display the character represented by Value
FFh Read a character
Output
Value = FF
A character is available
zero flag = clear
al - character
A character is not available
zero flag set
Registers modified: ax, dl, flags
Syntax: ConsoleIO Value
UnfilteredCharInput
-------------------
Function: Performs character input without checking for CTRL_BREAK. The
character input is not written to the display device.
DOS Function: 07h
DOS Versions: 1, 2, 3
Input
none
Output
al - The character read.
Registers modified: ax, flags
Syntax: UnfilteredCharInput
CharInputNoEcho
---------------
Function: Reads a character without echoing it to the screen.
DOS Function: 08h
DOS Versions: 1, 2, 3
Input
none
Output
al - character read
Registers modified: ax, flags
Syntax: CharInputNoEcho
WriteString
-----------
Function: Displays a $ terminated string to the string using.
DOS Function: 09h
DOS Versions: 1, 2, 3
Input
StringSeg - segment address of the string
StringOfs - offset address of string in StringSeg
Output
none
Registers modified: ax, dx, ds, Flags
Syntax: WriteString StringSeg, StringOfs
BufferedInput
-------------
Function: Reads a line from the standard input device and stores it in the
indicated buffer.
DOS Function: 0Ah
DOS Versions: 1, 2, 3
Input
StringSeg - segment address of the buffer
StringOfs - offset of the storage buffer
Output
none
Registers modified: ah, dx, ds, flags
Syntax: BufferedInput StringSeg, StringOfs
GetInputStatus
--------------
Function: Determines if a character is ready to be input.
DOS Function: 0Bh
DOS Versions: 1, 2, 3
Input
none
Output
al - 0 = no character available, FFh = character available
Registers modified: ax, flags
Syntax: GetInputStatus
ResetInputBuffer
----------------
Function: Resets the input buffer(i.e. clears its contents) and then waits for
a character. Note that if Function <> 0Ah, you do not need to provide
the StringSeg:StringOfs parameters.
DOS Function: 0Ch
DOS Versions: 1, 2, 3
Input
Function - number of the input function to invoke.
StringSeg - If Function = 0Ah, segment address of the buffer
StringOfs - offset of storage buffer
Output
Function = 0Ah
none
al - character read
Registers modified: ax, dx, ds, flags
Syntax: ResetInputBuffer Function, StringSeg, StringOfs
ResetDisk
---------
Function: Resets a disk. All buffers are flushed to the disk.
DOS Function: 0Dh
DOS Versions: 1, 2, 3
Input
none
Output
none
Registers modified: ah, flags
Syntax: ResetDisk
ChangeDrive
-----------
Function: Changes the default disk drive.
DOS Function: 0Eh
DOS Versions: 1, 2, 3
Input
Drive - Drive to change to
Output
al - number of logical drives in system
Registers modified: al, dl, Flags
Syntax: ChangeDrive Drive
OpenFCBFile
-----------
Function: Opens a file using an FCB and prepares it for I/O.
DOS Function: 0Fh
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
Output
al - 0 = operation successful, FFh = operation failed
Registers modified: ax, dx, ds, flags
Syntax: OpenFCBFile FCBSeg, FCBOfs
CloseFCBFile
------------
Function: Closes a file using an FCB.
DOS Function: 10h
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
Output
al - 0 = operation successful, FFh = operation failed
Registers modified: ax, dx, ds, flags
Syntax: CloseFCBFile FCBSeg, FCBOfs
FindFirstFCB
------------
Function: Finds the first file in a directory that matches a given file
specification. File operations are performed using FCB's.
DOS Function: 11h
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
Output
al - 0 = operation successful, FFh = operation failed
Registers modified: ax, dx, ds, flags
Syntax: FindFirstFCB FCBSeg, FCBOfs
FindNextFCB
-----------
Function: Finds the next entry in a directory matching the last file
specification given to FindFirstFCB.
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
Output
al - 0 = operation successful, FFh = operation failed
Registers modified: ax, dx, ds, flags
Syntax: FindNextFCB FCBSeg, FCBOfs
DeleteFCBFile
-------------
Function: Deletes a file defined in an FCB.
DOS Function: 13h
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
Output
al - 0 = operation successful, FFh = operation failed
Registers modified: ax, dx, ds, flags
Syntax: DeleteFCBFile FCBSeg, FCBOfs
SequentialFCBRead
-----------------
Function: Performs a sequential read from a file opened using an FCB.
DOS Function: 14h
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
Output
al - 0 = read successful
1 = end of file
2 = segment wrap
3 = partial record read at eof
Registers modified: ax, dx, ds, flags
Syntax: SequentialFCBRead FCBSeg, FCBOfs
SequentialFCBWrite
------------------
Function: Performs a sequential write to a file opened using an FCB.
DOS Function: 15h
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
Output
al - 0 = write successful
1 = disk full
2 = segment wrap
Registers modified: ax, dx, ds, flags
Syntax: SequentialFCBWrite FCBSeg, FCBOfs
CreateFCBFile
-------------
Function: Creates a new file or truncates an existing file using an FCB.
DOS Function: 16h
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
Output
al - 0 = operation successful, FFh = operation failed
Registers modified: ax, dx, ds, flags
Syntax: CreateFCBFile FCBSeg, FCBOfs
RenameFCBFile
-------------
Function: Renames a file(s) defined in an FCB.
DOS Function: 17h
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
Output
al - 0 = operation successful, FFh = operation failed
Registers modified: ax, dx, ds, flags
Syntax: RenameFCBFile FCBSeg, FCBOfs
GetDrive
--------
Function: Returns the default disk drive.
DOS Function: 19h
DOS Versions: 1, 2, 3
Input
none
Output
al - drive code(0 = A, 1 = B, etc.)
Registers modified: al, Flags
Syntax: GetDrive
SetDTA
------
Function: Sets the current DTA address.
DOS Function: 1Ah
DOS Versions: 1, 2, 3
Input
StringSeg - segment address of new DTA
DTAOfs - offset in StringSeg of new DTA
Output
none
Registers modified: ax, dx, ds, Flags
Syntax: SetDTA DTASeg, DTAOfs
DefaultDiskAllocation
---------------------
Function: Gets the allocation information for the default disk drive.
DOS Function: 1Bh
DOS Versions: 1, 2, 3
Input
none
Output
al - sectors per cluster
ds:bx - address of the FAT id byte
cx - # of bytes per physical sector
dx - number of clusters on default drive
Registers modified: ax, bx, cx, dx, ds, flags
Syntax: DefaultDiskAllocation
DiskAllocation
--------------
Function: Gets the allocation information for a specific disk drive.
DOS Function: 1Ch
DOS Versions: 2, 3
Input
dl - drive id(0 = default, 1 = A, etc.)
Output
al - sectors per cluster
ds:bx - address of the FAT id byte
cx - # of bytes per physical sector
dx - number of clusters on default drive
Registers modified: ax, bx, cx, dx, ds, flags
Syntax: DiskAllocation Drive
RandomFCBRead
-------------
Function: Reads the indicated record from a file opened using an FCB.
DOS Function: 21h
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
Output
al - 0 = read successful
1 = end of file
2 = segment wrap
3 = partial record read at eof
Registers modified: ax, dx, ds, flags
Syntax: RandomFCBRead FCBSeg, FCBOfs
RandomFCBWrite
--------------
Function: Writes a record to the indicated position in a file opened using an
FCB.
DOS Function: 22h
DOS Versions: 1, 2, 3
Input
FCBSeg - segment address of the File Control Block(FCB)
FCBOfs - offset of FCB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -