B800:0000—— 2000H字 彩色显示器的显示缓冲区, 每个字中的低字节是字符的ASCII码,高字节是其属性.
背景属性:高四位 7 6 5 4
前景属性:低四位 3 2 1 0
7 6 5 4 3 2 1 0
Blink Red Green Blue Bright Red Green Blue
sample code:
;int 21功能调用输出字符
.model small
.stack 10
.data
string db "hello world from int 21h!"
endstring db "$"
.code
main proc
mov ax,seg string
mov ds,ax
mov dx,offset string
mov ah,09h
int 21h
mov ax,4c00h
int 21h
main endp
end main
;通过直接修改显示缓冲区输出字符,优点速度快
.model small
.stack 10
.data
string db "hello world from The Video Memory!"
endstring db "$"
.code
main proc
mov ax,seg string
mov ds,ax
mov ax,0b800h
mov es,ax
lea si,string
mov di,0f00h
mov cx,endstring-string
aa: mov al,[si]
mov es:[di],al
inc si
add di,2
loop aa
mov ax,4c00h
int 21h
main endp
end main
阅读(2215) | 评论(2) | 转发(0) |