assume cs:code
code segment
start:
mov ah,0
int 16h
mov ah,1
cmp al,'r'
je red
cmp al,'g'
je green
cmp al,'b'
je blue
jmp short nothing
red:
mov ah,4
call setColor
jmp short nothing
blue:
mov ah,1
call setColor
jmp short nothing
green:
mov ah,2
call setColor
jmp short nothing
nothing:nop
mov ax,4c00h
int 21h
setColor:
push bx
push cx
push es
mov cx,0b800h
mov es,cx
mov cx,2000
mov bx,1
s:
and byte ptr es:[bx],11111000b
or es:[bx],ah
add bx,2
loop s
pop es
pop cx
pop bx
ret
code ends
end start
(汇编语言)编程,输入r g b字符颜色改变为红绿蓝
最新推荐文章于 2021-03-13 07:18:30 发布