INT 10

INT 10h / AH = 0 - set video mode.

input:
AL = desired video mode.

these video modes are supported:

00h - text mode. 40x25. 16 colors. 8 pages.

03h - text mode. 80x25. 16 colors. 8 pages.

13h - graphical mode. 40x25. 256 colors. 320x200 pixels. 1 page.

example:


	mov al, 13h
	mov ah, 0
	int 10h

Back to Top


INT 10h / AH = 01h - set text-mode cursor shape.

input:
CH = cursor start line (bits 0-4) and options (bits 5-7).
CL = bottom cursor line (bits 0-4).

when bit 5 of CH is set to  0, the cursor is visible. when bit 5 is  1, the cursor is not visible.

; hide blinking text cursor: 
     	mov ch, 32
     	mov ah, 1
     	int 10h

; show standard blinking text cursor: 
     	mov ch, 6
     	mov cl, 7
     	mov ah, 1
     	int 10h

; show box-shaped blinking text cursor: 
     	mov ch, 0
     	mov cl, 7
     	mov ah, 1
     	int 10h

;     	note: some bioses required CL to be >=7,
;     	otherwise wrong cursor shapes are displayed. 

Back to Top


INT 10h / AH = 2 - set cursor position.

input:
DH = row.
DL = column.
BH = page number (0..7).

example:


	mov dh, 10
	mov dl, 20
	mov bh, 0
	mov ah, 2
	int 10h

Back to Top


INT 10h / AH = 03h - get cursor position and size.

input:
BH = page number.
return:
DH = row.
DL = column.
CH = cursor start line.
CL = cursor bottom line.

Back to Top


INT 10h / AH = 05h - select active video page.

input:
AL = new page number (0..7).
the activated page is displayed.

Back to Top 


INT 10h / AH = 06h - scroll up window.
INT 10h / AH = 07h - scroll down window.

input:
AL = number of lines by which to scroll (00h = clear entire window).
BH =  attribute used to write blank lines at bottom of window.
CH, CL = row, column of window's upper left corner.
DH, DL = row, column of window's lower right corner.

Back to Top


INT 10h / AH = 08h - read character and attribute at cursor position.

input:
BH = page number.
return:
AH =  attribute.
AL = character.

Back to Top


INT 10h / AH = 09h - write character and attribute at cursor position.

input:
AL = character to display.
BH = page number.
BL =  attribute.
CX = number of times to write character.

Back to Top


INT 10h / AH = 0Ah - write character only at cursor position.

input:
AL = character to display.
BH = page number.
CX = number of times to write character.

Back to Top


INT 10h / AH = 0Ch - change color for a single pixel.

input:
AL = pixel color
CX = column.
DX = row.

example:


	mov al, 13h
	mov ah, 0
	int 10h     ; set graphics video mode. 
	mov al, 1100b
	mov cx, 10
	mov dx, 20
	mov ah, 0ch
	int 10h     ; set pixel. 

Back to Top


INT 10h / AH = 0Dh - get color of a single pixel.

input:
CX = column.
DX = row.
output:
AL = pixel color

Back to Top


INT 10h / AH = 0Eh - teletype output.

input:
AL = character to write.

this functions displays a character on the screen, advancing the cursor and scrolling the screen as necessary. the printing is always done to current active page. 

example:


	mov al, 'a'
	mov ah, 0eh
	int 10h

	; note: on specific systems this
	; function may not be supported in graphics mode. 

Back to Top


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.

example:


	mov al, 1
	mov bh, 0
	mov bl, 0011_1011b
	mov cx, msg1end - offset msg1 ; calculate message size. 
	mov dl, 10
	mov dh, 7
	push cs
	pop es
	mov bp, offset msg1
	mov ah, 13h
	int 10h
	jmp msg1end
	msg1 db " hello, world! "
	msg1end:

Back to Top


INT 10h / AX = 1003h - toggle intensity/blinking.

input:
BL = write mode:
     0: enable intensive colors.
     1: enable blinking (not supported by the emulator and windows command prompt).
BH = 0 (to avoid problems on some adapters).

example:


mov ax, 1003h
mov bx, 0
int 10h


bit color table:
character attribute is 8 bit value, low 4 bits set fore color, high 4 bits set background color.
note: the emulator and windows command line prompt do not support background blinking, however to make colors look the same in dos and in full screen mode it is required to turn off the background blinking.


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

note:


; use this code for compatibility with dos/cmd prompt full screen mode: 
mov     ax, 1003h
mov     bx, 0   ; disable blinking. 
int     10h

http://www.emu8086.com/assembly_language_tutorial_assembler_reference/8086_bios_and_dos_interrupts.html

http://blog.csdn.net/thimin/archive/2008/04/22/2313390.aspx

 

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值