关于在屏幕上显示的问题
实验九
在屏幕上显示七彩的文字
assume cs:code,ds:data
data segment
db 'welcome to masm!'
data ends
code segment
start: mov ax,data
mov ds,ax
mov ax,0b86eh
mov es,ax
mov bx,0
mov si,0
mov cx,16
s:mov al,
mov es:,al
mov es:,al
mov es:,al
mov al,02h
mov es:,al
mov al,24h
mov es:,al
mov al,71h
mov es:,al
inc bx
add si,2
loop s
mov ax,4c00h
int 21
code ends
end start
我快被逼疯了,不知道为什么,只打两行字的话,显示很正常,加入第三行(带颜色)的话,就会显示乱码!
求助!到底是为什么会这样?!
本帖最后由 jackz007 于 2019-6-19 04:13 编辑
stack segment stack
dw 800h dup(00)
stack ends
data segment
db 'welcome to masm!' , 00h
data ends
code segment
assume cs:code,ds:data
start proc far
mov ax,data
mov ds,ax
mov ax,0b800h
mov es,ax
xor si,si
mov di,6e0h
cld
start01: lodsb
or al,al
jz start02
mov es:,al
mov es:,al
mov es:,al
mov byte ptr es:,02h
mov byte ptr es:,24h
mov byte ptr es:,71h
add di,2
jmp start01
start02: xor ah,ah
int 16h
mov ax,4c00h
int 21h
start endp
code ends
end start int 21h
页:
[1]