📄 biosmac.doc
字号:
Syntax: PutCharAttr Character, Attribute, Count, Page
PutChar
-------
Function: Displays a character Count times beginning at the current cursor
position on the indicated display page. Note that the Page and
Color parameters are optional. If you provide the Color parameter,
you must also provide the Page parameter. If the Page parameter is
not provided, video page 0 is used. If the Color is not provided,
the character attribute of the current cursor location of the
indicate video page is used.
BIOS Interrupt: 10h Service: 0Ah
Input
Character - character to display
Count - number of times to display the character
Page - video page to display character(s) on
Output
none
Registers modified: ax, bx, cx, Flags
Syntax: PutChar Character, Count, Page, Color
SetColorPalette
---------------
Function: Sets the CGA color palette that is used while displaying graphics
in 320x200 graphics mode(4 & 5). For more information on video
modes, see SetVideoMode above.
BIOS Interrupt: 10h Service: 0Bh
Input
Entry - Color palette id being set
Color - New color for palette entry
Output
none
Registers modified: ah, bx, Flags
Syntax: SetColorPalette Entry, Color
PutPixel
--------
Function: Displays a pixel on the screen. Note that the macro may only be
called while in graphics mode.
BIOS Interrupt: 10h Service: 0Ch
Input
X - horizontal position
Y - vertical position
Color - color/display method for pixel
Output
none
Registers modified: ax, cx, dx, Flags
Syntax: PutPixel X, Y, Color
GetPixel
--------
Function: Reads information about the indicated pixel.
BIOS Interrupt: 10h Service: 0Dh
Input
X - horizontal position
Y - vertical position
Output
al - pixel information
Registers modified: ax, cx, dx, Flags
Syntax: GetPixel X, Y
PutTTY
------
Function: Displays text to the console using teletype mode. Note that the
Color parameter is optional. If the Color parameter isn't provided,
the character will be displayed using the attribute of the current
cursor position.
BIOS Interrupt: 10h Service: 0Eh
Input
Character - character to display
Color - color to display text in.
Page - video page to display character(s) on
Output
none
Registers modified: ax, bx, Flags
Syntax: PutTTY Character, Page, Color
GetVideoMode
------------
Function: Determines the current video mode and display page.
BIOS Interrupt: 10h Service: 0Fh
Input
None
Output
ah - Number of columns on screen
al - display 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)
----------------------------------------------------
bh - Active display page
Register modified: ax, bx, Flags
Syntax: GetVideoMode
SetPaletteRegs
--------------
Function: Sets the EGA palette colors. Note that the macro may only be called
when running on an EGA.
BIOS Interrupt: 10h Service: 10h
Input
SubService - Select service as defined below
SERVICE FUNCTION
------- -----------------------------------------------------
0 If setting palette register
1 If setting border color register
2 If setting all palette registers and border register
3 If toggling blink/intensity bit(EGA only)
-----------------------------------------------------------------
IndexIntensity - palette register or blink/intensity bit as
defined below.
SERVICE FUNCTION
------- -------------------------------------------------
SubService = 0 Palette register to set
SubService = 3 IndexIntensity = 0 - Enable intensity
IndexIntensity = 1 - Enable blinking
-----------------------------------------------------------------
Color - color to store in register
ListSeg:ListOfs - address of new palette list
Output
none
Registers modified: ax, bx, dx, es, Flags
Syntax: SetPaletteRegs SubService, IndexIntensity, Color, ListSeg, ListOfs
ScreenRows
----------
Function: Returns the number of rows available on the screen.
BIOS Interrupt: 10h Service: 11h
Input
none
Output
dl - # of rows on the screen(25/43/50)
Registers modified: ax, dl, Flags
Syntax: ScreenRows
PutString
---------
Function: Displays a string to the indicated video page at the indicated
position. Note that the Page and Attribute parameters are optional.
If Page is not supplied, the macro will use page 0 by default. If
Mode = 0 or 1, Attribute must be supplied. If Mode = 2 or 3,
Attribute should not be supplied. Note that if you provide the
Attribute parameter, you must provide the Page parameter also. This
macro may only be used on IBM-AT, PS/2 and compatible machines.
BIOS Interrupt: 10h Service: 13h
Input
Mode - mode to write string in as defined below
MODE FUNCTION
---- --------
0 Attribute in bl, string contains character codes only,
cursor position isn't updated after write.
1 Attribute in bl, string contains character codes only,
cursor position is updated after write.
2 String contains alternating character codes and
attribute bytes, cursor position isn't updated after
write.
3 String contains alternating character codes and
attribute bytes, cursor position is updated after write.
--------------------------------------------------------------------
X - Vertical position to begin display of the string
Y - Horizontal position to begin display of the string.
StringSeg - Segment address of the string
StringOfs - Offset address of string in StringSeg
Length - Length of the string to be displayed
Page - Video page to display string to
Attribute - Optional parameter that indicates the attribute to
display the string in. This parameter should only be
provided if Mode = 0 or 1.
Output
none
Registers modified: ax, bx, cx, dx, bp, es, Flags
Syntax: PutString Mode, X, Y, StringSeg, StringOfs, Length, Page, Attribute
GetChar
-------
Function: Returns the next character in the BIOS keyboard buffer.
BIOS Interrupt: 16h Service: 00h
Input
none
Output
ah - keyboard scan code
al - ASCII character
Registers modified: ax, Flags
Syntax: GetChar
GetKbdStatus
------------
Function: Returns the BIOS keyboard status.
BIOS Interrupt: 16h Service: 01h
Input
none
Output
If key wating to be input:
Zero flag - clear
ah - keyboard scan code
al - ASCII character
If no key waiting to be input:
Zero flag - set
Registers modified: ax, Flags
Syntax: GetKbdStatus
GetKbdFlags
-----------
Function: Returns the BIOS keyboard flags.
BIOS Interrupt: 16h Service: 02h
Input
none
Output
al - BIOS keyboard flags byte:
BIT FUNCTION
--- --------
7 Insert ON
6 Caps Lock ON
5 Num Lock ON
4 Scroll Lock ON
3 Alt key DOWN
2 Ctrl key DOWN
1 Left-Shift key DOWN
0 Right-Shift key DOWN
Registers modified: al, Flags
Syntax: GetKbdFlags
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -