Using INT 10h ah13h 详解

本文详细介绍了BIOS INT10h功能13h的使用方法及参数,包括写入模式、寄存器设置及颜色属性表等关键信息。此功能可用于在显示器上写入ASCII字符串。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在自己动手写操作系统中用到了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


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值