本帖最后由 yundi 于 2016-1-28 12:54 编辑
BIOS,DOS中断
先不用中断做个练习;在屏幕5行12列显示3个红底高亮闪烁绿色的'a'
;参数dh=行号,dl=列号,al=字符,cx=重复次数
assume cs:code
code segment
start:
mov dh,5
mov dl,12
mov al,'a'
mov cx,3 ;参数赋值
call showa;调子程序
mov ax,4c00h
int 21h
showa:
push ax
mov ax,0b800h
mov ds,ax;段0b800h
mov bx,0
mov al,160
mul dh;160*dh
add bx,ax
mov al,2
mul dl;2*dl
add bx,ax;偏移160*行+2*列
pop ax;
s: mov byte ptr ds:[bx],al
mov byte ptr ds:[bx+1],11001010b
add bx,2
loop s
ret
code ends
end start
用上提供的中断例程,变得简单多了;在屏幕5行12列显示3个红底高亮闪烁绿色的'a'
assume cs:code
code segment
start:
;定位光标
mov ah,2
mov bh,0
mov dh,5
mov dl,12
int 10h
;显示
mov ah,9
mov al,'a'
mov bl,11001010b
mov bh,0
mov cx,3
int 10h
mov ax,4c00h
int 21h
code ends
end start
|