如何INT 10,带有属性13H的工作? [英] How does INT 10, 13h work with attributes?
问题描述
哎我试着去了解INT 10H,这与BIOS中断10用啊13H写入字符串13H(19)。我发现下面对不同的标志放置在不同的寄存器中的信息。有一件事我还是不明白什么是应该在BL去,如果我只是想写出具有这种功能应该是BL什么作为属性字符串?
现在它写出奇怪的符号闪烁,这没有意义。谢谢你,事先
写入指定属性的字符的字符串任何显示
页。 在进入:AH 13H
AL子服务(0-3)
BH显示页码
BL属性(子服务0和1)
字符串的长度CX
DH行位置字符串写入
DL列位置,其中字符串是要被写入
ES:BP指向字符串的指针来写 返回:无 注:此服务只适用于日86年1月19日XTS
后来,ATS,特惠津贴,以及PC敞篷。 该服务具有四个子服务,具体如下: AL = 00H:将所有的字符BL属性;
不更新光标
AL = 01H:将所有的字符BL属性;
更新游标
AL = 02H:使用字符串属性;不更新
光标
AL = 03H:使用字符串属性;更新游标 在子服务0和1,在字符串中的所有字符
被写入到屏幕用相同的attribute--
在BL指定的属性。 在子服务2和3中,对于每个属性字节
字符字符串本身中找到的。字符串
本身由一个字符后面的其
属性,另一个字符后面的
属性,等等。该字符串直接复制
到视频缓冲器原样。 在子服务0和2,光标位置不
该字符串被写入后更新。 在子服务1和3,将光标移动到
在最后一个字符之后第一个位置
串。 像服务0EH,服务13H适当的反应
以ASCII 07H(钟),08H(退格键),10H(行
料),0DH(回车)。所有其他
字符打印。
通过 INT 10H
的 BL
寄存器用于色彩属性。
除非你正在处理CGA,其中 BL
值是调色板数, BL
值一些重presenting前景色(4位 - 低部分)和背景颜色(4位 - 高部分)。
举例来说,如果你想用红色(0×04)文本颜色蓝色(0x01)的背景下,你需要把 0×14
到 BL
注册 - 二进制是 00010100
0001 0100
| _背景_ | | _前景_ |
颜色通常是:
- 黑色为0x00
- 蓝色为0x01
- 绿色0X02
- 青色×03
- 红色0×04
- 品红0×05
- 布朗0×06
- 浅灰色值为0x07
- 深灰0x08的
- LightBlue为0x09
- 浅绿的0x0A
- 浅青绿0x0B中
- LightRed的0x0C
- LightMagenta 0X0D
- LightBrown为0x0E
- 白色为0x0F
Hey Im trying to understand the INT 10h, 13h (19) that writes a Character String with the BIOS interruption 10 with 13h in ah. I have found the info below about the different flags to put in the the different registers. One thing I still don't get is what is supposed to go in BL, if i simply want to write a string with this function what should be in BL as attribute? Right now it writes out strange blinking symbols that don't make sense. Thank you, beforehand
Writes a string of characters with specified attributes to any display
page.
On entry: AH 13h
AL Subservice (0-3)
BH Display page number
BL Attribute (Subservices 0 and 1)
CX Length of string
DH Row position where string is to be written
DL Column position where string is to be written
ES:BP Pointer to string to write
Returns: None
Notes: This service is available only for XTs dated 1/19/86
and later, ATs, EGAs, and PC Convertibles.
The service has four subservices, as follows:
AL=00h: Assign all characters the attribute in BL;
do not update cursor
AL=01h: Assign all characters the attribute in BL;
update cursor
AL=02h: Use attributes in string; do not update
cursor
AL=03h: Use attributes in string; update cursor
In Subservices 0 and 1, all characters in the string
are written to the screen with the same attribute--
the attribute specified in BL.
In Subservices 2 and 3, the attribute byte for each
character is found in the string itself. The string
itself consists of a character followed by its
attribute, another character followed by its
attribute, and so on. The string is copied directly
to the video buffer as is.
In Subservices 0 and 2, the cursor position is not
updated after the string is written.
In Subservices 1 and 3, the cursor is moved to the
first position following the last character in the
string.
Like Service 0Eh, Service 13h responds appropriately
to ASCII 07h (bell), 08h (backspace), 10h (line
feed), and 0Dh (carriage return). All other
characters are printed.
With int 10h
, the BL
register is used for the colour attributes.
Unless you're dealing with CGA, where the BL
value is the palette number, the BL
value is a number representing the foreground color (4 bits - low part) and the background color (4 bits - high part).
For instance, if you want a blue (0x01) background with red (0x04) text colour, you'll need to put 0x14
into the BL
register - in binary that is 00010100
.
0001 0100
|_ Background _| |_ Foreground _|
Colours are usually:
- Black 0x00
- Blue 0x01
- Green 0x02
- Cyan 0x03
- Red 0x04
- Magenta 0x05
- Brown 0x06
- LightGray 0x07
- DarkGray 0x08
- LightBlue 0x09
- LightGreen 0x0A
- LightCyan 0x0B
- LightRed 0x0C
- LightMagenta 0x0D
- LightBrown 0x0E
- White 0x0F
这篇关于如何INT 10,带有属性13H的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!