macro.doc
来自「汇编&c语言code」· DOC 代码 · 共 661 行 · 第 1/2 页
DOC
661 行
BX = Available clusters
CX = Bytes per sector
DX = Clusters per drive
Registers used: AX, BX, CX, and DX
PROCESS CONTROL
@Exit (4Ch)
Exits to DOS with return code
Syntax: @Exit [#return]
Argument: return = 8-bit code to return to DOS; if none given,
AL is used
Return: None
Registers used: AX
@Exec (4Bh)
Executes a child process or an overlay
Syntax: @Exec path, params [,[segpath] [,[segparams] [,overlay]]]
Arguments: path = Offset of ASCIIZ filespec to be executed
params = Offset of process parameter block
segpath = Segment of filespec (DS if none given)
segparams = Segment of parameter block (ES if none given)
overlay = If not defined, normal process executed;
if defined, overlay executed
Return: If carry set, error code
Registers used: AX, SI, and DI; DS and ES if corresponding segments given
@GetRet (4Dh)
Gets the return code of a child process
Syntax: @GetRet
Argument: None
Return: Return code in AX
Register used: AX
@TSR (31h)
Terminates a program, but leaves it resident in memory
Syntax: @TSR paragraphs [,#return]
Arguments: return = Code to return to DOS; if none, AL used
paragraphs = Memory in paragraphs (16 bytes) to
allocate for resident program
Return: None
Registers used: AX and DX
MEMORY CONTROL
@FreeBlok (49h)
Frees a block of memory
Syntax: @FreeBlok [segment]
Argument: segment = Starting address of memory to be freed;
if none, ES address assumed
Return: If carry set, error code in AX
Register used: AX; ES if segment given
@GetBlok (48h)
Allocates a block of memory
Syntax: @GetBlok paragraphs
Argument: paragraphs = Paragraphs (16 bytes) of memory wanted
Return: AX and ES = Segment address of allocated memory
BX = Paragraphs actually allocated (may be
less than requested if memory is short)
Register used: AX and BX
@ModBlok (48h)
Modifies an allocated block of memory
Syntax: @ModBlok paragraphs [,segment]
Argument: paragraphs = Paragraphs (16 bytes) of memory wanted
segment = Starting address of memory to be freed;
if none, ES address assumed
Return: If carry set, error code in AX, else:
ES = Segment address of allocated memory
BX = If carry is clear, paragraphs allocated
Register used: AX and BX; ES if segment given
MISCELLANEOUS
@GetDate (2Ah) and @SetDate (2Bh)
Gets or sets the system date
Syntax: @GetDate
@SetDate month, day, year
Arguments: year = 16-bit year (1980-2099)
month = 8-bit month (1-12)
day = 8-bit day (1-31)
Return: For @GetDate:
AL = Day of week (0 = Sunday, 1 = Monday, etc.)
CX = Year (1980-2099)
DL = Month (1-12)
DH = Day (1-31)
For @SetDate:
AL = If date was valid 0, else -1
Registers used: AX, CX, and DX
@GetTime (2Ch) and @SetTime (2Dh)
Gets or sets the system time
Syntax: @GetTime
@SetTime hour,minute,second,hundredth
Arguments: hour = 8-bit hour (0-23)
minute = 8-bit hour (0-59)
second = 8-bit hour (0-59)
hundredth = 8-bit hour (0-99)
Return: For @GetTime:
CL = Hour (0-23)
CH = Minute (0-59)
DL = Second (0-59)
DH = Hundredth (0-99)
For @SetTime:
AL = If time was valid 0, else -1
Registers used: AX, CX, and DX
@GetVer (30h)
Gets the DOS version
Syntax: @GetVer
Argument: None
Return: AL = Major version (0 for versions prior to 2.0)
AH = Minor version
BH = OEM serial number
BL:CX = 24-bit user number
Register used: AX, BX, and CX
@GetInt (35h) and @SetInt (25h)
Gets or sets the vector for a specified interrupt routine
Syntax: @GetInt #interrupt
@SetInt #interrupt, &vector [,segment]
Arguments: interrupt = 8-bit interrupt number
vector = Offset of interrupt routine
segment = Segment of routine - if none given, DS assumed
for data; segment ignored for code labels
Return: @GetInt = None
@SetInt = ES:BX points to interrupt routine
Registers used: AX for both; ES and BX for @GetInt; DS and DS for @SetInt
BIOS Macro Syntax and Description
MODE, PAGE, AND COLOR CONTROL
@GetMode (I 10h F 0Fh)
Gets the current video mode and page
Syntax: @GetMode
Arguments: None
Return: AL = Mode
AH = Width in characters
BH = Page
Registers used: AX and BH
@SetMode (I 10h F 00h)
Gets the current video mode and page
Syntax: @SetMode mode
Arguments: mode = 8-bit video mode
Return: none
Registers used: AX
@SetColor (I 10h F 0Bh)
Sets the background color
Syntax: @SetColor color
Arguments: color = 8-bit background color (0-15);
border color in text modes
Return: none
Registers used: AX and BX
@SetPalet (I 10h F 0Bh)
Sets the color palette
Syntax: @SetPalet color
Arguments: color = 8-bit color palette (0-1 for modes 5 and 6)
Return: none
Registers used: AX and BX
@SetPage (I 10h F 05h)
Sets the video page
Syntax: @SetPage page
Arguments: page = 8-bit page number; 0-3 for modes 2 and 3
Return: none
Registers used: AX
CHARACTER AND CURSOR CONTROL
@GetCur (I 10h F 04h)
Gets the cursor position and size
Syntax: @GetCur [page]
Arguments: page = 8-bit page with cursor (if none, 0 assumed)
Return: DL = Column
DH = Row
CL = Starting scan line
CH = Ending scan line
Registers used: AX, DX, CX, and BH
@SetCurPos (I 10h F 02h)
Sets the cursor position
Syntax: @SetCurSz [column] [,[row] [,page]]
Arguments: column = 8-bit column; if none, DL used
row = 8-bit row; if none, DH used
page = 8-bit page with cursor (if none, 0 assumed)
Return: none
Registers used: AX, DX, and BH
@SetCurSz (I 10h F 01h)
Sets the cursor size and shape by specifying active scan lines. The
CGA adapter the lines are 0-7. The monochrome adapter has lines 0-13.
Syntax: @SetCurSz startline, endline
Arguments: startline = 8-bit starting scan line (default CGA=6; MA=12)
endline = 8-bit ending scan line (default CGA=7; MA=13)
Return: none
Registers used: AX and CX
@GetChAtr (I 10h F 08h)
Gets the character and attribute at the cursor location
Syntax: @GetChAtr [page]
Arguments: page = 8-bit page to check (if none, 0 assumed)
Return: AH = Attribute
AL = ASCII character
Registers used: AX and BH
@PutChAtr (I 10h F 09h) and @PutCh (I 10h F 0Ah)
Puts one or more characters and attributes at the current cursor
position. For @PutCh, the current attribute is used in text modes
and any specified attribute is ignored.
Syntax: @PutChAtr [character] [,[attrib] [,[page] [,count]]]
Arguments: character = 8-bit ASCII character to put; if none, AL used
attrib = 8-bit attribute to put; if none, BL used
page = 8-bit page to put on (if none, 0 assumed)
count = Number to put (if none, 1 assumed)
Return: AH = Attribute
AL = ASCII character
Registers used: AX, BX, CX
@Scroll (I 10h F 06h and 07h)
Scrolls a specified window up or down
Syntax: @Scroll dist [,[attr] [,[uprow [,[upcol [,[dnrow] [,dncol]]]]]
Arguments: dist = 8-bit number of lines to scroll; positive
scrolls down; negative scrolls up; 0 clears
attr = 8-bit attribute for blank lines (if none, 07h)
uprow = Upper left row (if none, CH used)
upcol = Upper left column (if none, CL used)
dnrow = Lower right row (if none, DH used)
dncol = Lower right column (if none, DL used)
Return: none
Registers used: AX, CX, DX, and BH
@Cls (I 10h F 06, 08h, and 02h)
Clears the screen of the current page
Syntax: @Cls
Arguments: None
Return: None
Registers used: AX, BX, CX, and DX
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?