📄 biosmac.doc
字号:
FILENAME: BIOSMAC.DOC
DESCRIPTION: This file documents the BIOS interface macros implemented in
the files IBIOS.MAC and MBIOS.MAC. Note that the only difference between the
two files is that IBIOS.MAC uses TASM's Ideal mode while MBIOS.MAC uses
TASM's MASM mode.
CallBIOS
--------
Function: Calls the specified BIOS interrupt/service.
Input
Interrupt - Interrupt number
Service - Service number
Output
none
Registers modified: ah, flags
Syntax: CallBIOS Interrupt, Service
LoadBH
------
Function: Loads BH with the a value. Presumably the video page. If no value
is provided BH is initialized to 0.
Input
Value - value to put in BH
Output
none
Registers modified: bh
Syntax: LoadBH Value
SetVideoMode
------------
Function: Sets the current video mode.
BIOS Interrupt: 10h Service: 00h
Input
Mode - new video mode as defined below
---- ----------------------------------------------------
0h 40x25 Black and White
1h 40X25 Color
2h 80x25 Black and White
3h 80x25 Color
4h 320x200 4-Color graphics
5h 320x200 4-Color graphics(color burst off)
6h 640x200 2-Color graphics
7h Monochrome adapter Text display
8h 160x200 16-Color graphics(PCjr)
9h 320x200 16-Color graphics(PCjr)
0Ah 640x200 4-Color graphics(PCjr)
0Dh 320x200 16-Color graphics(EGA)
0Eh 640x200 16-Color graphics(EGA)
0Fh 640x350 Monochrome graphics(EGA)
10h 640x350 4-Color or 16-Color graphics(EGA)(depends on
available RAM)
11h 640x480 2-Color graphics(VGA)
12h 640x480 16-Color graphics(VGA)
13h 320x200 256-Color graphics(VGA)
----------------------------------------------------
Output
none
Registers modified: ah, Flags
Syntax: SetVideoMode Mode
SetCursorShape
--------------
Function: Sets the cursors shape. The parameters passed to it indicate the
starting and ending scan lines to use when displaying the cursor.
On a monochrome system the default setting is lines 6-7. Setting
the scan lines to 0-7 would result in a block cursor. On a color
system the default setting is 14-15. Setting the starting scan line
to 15 and the ending scan line to 0 would result in a cursor with a
line on the top and bottom.
BIOS Interrupt: 10h Service: 01h
Input
Starting - starting scan line
Ending - ending scan line
Output
none
Registers modified: ah, cx, Flags
Syntax: SetCursorShape Starting, Ending
GotoXY
------
Function: Positions the cursor.The new cursor position is provided in the
parameters Row and Column. The caller can optionally provide the
video page to use. If Page isn't defined, page 0 is assumed.
BIOS Interrupt: 10h Service: 02h
Input
Row (y coordinate)
Column (x coordinate)
Page - Display page to check
Output
none
Register modified: ax, bh, dx, Flags
Syntax: GotoXY Row, Column, Page
WhereXY
-------
Function: Determines the current cursor position and the cursor's shape. The
Page parameter indicates the video page to check and is optional.
If the Page parameter is not specified, page 0 is assumed.
BIOS Interrupt: 10h Service: 03h
Input
Page - Display page to check
Output
ch - Starting line for cursor
cl - Ending line for cursor
dh - row (y coordinate)
dl - column (x coordinate)
Register modified: ax, cx, dx, Flags
Syntax: WhereXY Page
GetCursorShape
--------------
Function: Returns the shape of the cursor. Note that because the BIOS call to
get the cursor's position returns this information we simply call
the WhereXY macro.
BIOS Interrupt: 10h Service: 03h
Input
none
Output
ch - starting scan line of cursor
cl - ending scan line of cursor
Registers modified: ax, cx, dx, Flags
Syntax: GetCursorShape
GetLightPenPos
--------------
Function: Returns the position of the light pen.
BIOS Interrupt: 10h Service: 04h
Input
none
Output
ah = 0 - light pen not down/not triggered
1 - light pen down/triggered
ch - pixel vertical coordinate
bx - pixel horizontal coordinate
dh - character vertical coordinate
dl - character horizontal coordinate
Registers modified: ah, bx, ch, dx, Flags
Syntax: GetLightPenPos
SetDisplayPage
--------------
Function: Sets the current display page. Note that the Page parameter is
optional. If it is not provided, video page 0 is used.
BIOS Interrupt: 10h Service: 05h
Input
Page - Desired display page as defined below
PAGE MODE HARDWARE
---- ---- --------
0-7 00h and 01h CGA
0-3 02h and 03h CGA
0-7 02h and 03h EGA
0-7 0Dh EGA
0-3 0Eh EGA
0-1 0Fh EGA
0-1 10h EGA
Output
none
Registers modified: ah, Flags
Syntax: SetDisplayPage Page
ScrollUp
--------
Function: Scrolls the indicated part of the screen up LineCount times. Any
blank lines created are initialized to the color indicated in the
Attrib parameter. The coordinate parameters are optional. If they
are not provided, the routine scrolls the entire screen. The routine
assumes there are 80 columns on the screen. However, it checks how
many lines are currently available (25/43/50) if the coordinate
parameters aren't provided.
BIOS Interrupt: 10h Service: 06h
Input
LineCount - # of lines to scroll
Attrib - Attribute to use for new lines
x1 - Upper left column
y1 - Upper row
x2 - Lower right column
y2 - Bottom row
Output
none
Registers modified: ax, bh, cx, dx, Flags
Syntax: ScrollUp LineCount, Attrib, x1, y1, x2, y2
ScrollDown
----------
Function: Scrolls the indicated part of the screen down LineCount times. Any
blank lines created are initialized to the color indicated in the
Attrib parameter. The coordinate parameters are optional. If they
are not provided, the routine scrolls the entire screen. The routine
assumes there are 80 columns on the screen. However, it checks how
many lines are currently available(25/43/50) if the coordinate
parameters aren't provided.
BIOS Interrupt: 10h Service: 07h
Input
LineCount - # of lines to scroll
Attrib - Attribute to use for new lines
x1 - Upper left column
y1 - Upper row
x2 - Lower right column
y2 - Bottom row
Output
none
Registers modified: ax, bh, cx, dx, Flags
Syntax: ScrollDown LineCount, Attrib, x1, y1, x2, y2
GetCharAttr
-----------
Function: Reads the character and attribute at the current cursor position of
the indicated video page. See SetDisplayPage for a definition of
the different video pages available. Note that the Page parameter
is optional. If it is not provided, video page 0 is used.
BIOS Interrupt: 10h Service: 08h
Input
Page - the video page to check
Output
ah - attribute
al - character
Registers modified: ax
Syntax: GetCharAttr Page
PutCharAttr
-----------
Function: Displays a character and attribute 'Count' times starting at the
current cursor position of the indicated page. Note that the Page
parameter is optional. If it is not provided, video page 0 is used.
BIOS Interrupt: 10h Service: 09h
Input
Character - character to display
Attribute - attribute to display the character(s) in
Count - number of times to display the character
Page - Video page to display the characters on
Output
none
Registers modified: ax, bx, cx, Flags
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -