`
lovnet
  • 浏览: 6705169 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
文章分类
社区版块
存档分类
最新评论

Using INT 10h ah13h 详解

阅读更多

在自己动手写操作系统中用到了bios int 10h中的ah13功能.这里特意把具体的细节写出来:

INT 10h / AH = 13h - write string.
input:
AL = write mode:
bit 0: update cursor after writing;
bit 1: string contains attributes.
BH = page number.
BL = attribute if string contains only characters (bit 1 of AL is zero).
CX = number of characters in string (attributes are not counted).
DL,DH = column, row at which to start writing.
ES:BP points to string to be printed.
-----------------------------------------------------
Bit color table:
Character attribute is 8 bit value, low 4 bits set foreground color, high 4 bits set background color. Background blinking not supported.
HEX BIN COLOR
0 0000 black
1 0001 blue
2 0010 green
3 0011 cyan
4 0100 red
5 0101 magenta
6 0110 brown
7 0111 light gray
8 1000 dark gray
9 1001 light blue
A 1010 light green
B 1011 light cyan
C 1100 light red
D 1101 light magenta
E 1110 yellow
F 1111 white

中文版内容:

Int 10h 功能13h 〈AT〉
写入串
399页
把ASCII串写到显示器上。
调用寄存器: AH 13h
AL 写入模式(参见表15.9)
BH 视频页
BL 属性(写入模式0和1)
CX 串长度
DH 串写入的行
DL 串写入的列
ES:BP 指向串的指针
返回寄存器:无
表15.9写串的模式
模式 注 释
0 BL中的属性。串只能是字符。未更新光标。
1 BL中的属性。串只能是字符。已更新光标。
2 串可采用字符或属性。未更新光标。
3 串可采用字符或属性。已更新光标。
注释:仅仅在BiOS日期为1/10/86或以后的PC XT Personal Computer AT
以及PS/2系列的机器上该功能才可用,其作用就是把字符串写到当前活动
的显示页上。
可用该功能来标识某个串(通过字符的嵌入或全局属性来标识),并接着
把它写给屏幕。由于该功能依靠其它的BIOS功能来写入串,因而其速度不是
很快。
功能13h是用电传式中断(Teletype interrupt)(Int 10h,功能0Eh)来进行
输出的,这就决定了它通过把光标回移一个位置、拉响控制台报警器、下移一
行或把光标移至当前行的开头的方式来分别响应退格(ASCII 08h)、响铃
(ASCII 07h)、换行(ASCII 0Ah)以及回车(ASCII 0Dh)等字符。它还能实现显
示行的下滚和上滚。

参考资料:

DOS程序员参考手册(BIOS参考手册) http://alexluo.blog.hexun.com/7975614_d.html

INT 10h Using http://www.cnblogs.com/BpLoveGcy/archive/2006/11/21/567976.html


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics