|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
请问逻辑哪错了呀。 为啥隔着字母显示
这是我的代码assume cs:code,ss:stack,ds:data
data segment
db'welcome to masm ',0
data ends
stack segment
dw 16 dup(0)
stack ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov dh,8
mov dl,3
mov cl,2
mov si,0
mov ax,0b800h
mov es,ax;显示基地指
call show_str
mov ax,4c00h
int 21h
show_str:
mov al,160
mov ah,dh
mul ah
mov bx,ax
mov ah,0
mov al,2
mul dl;一个字符2b 列
add bx,ax;列行实际地址
mov al,cl;颜色储存在al
colour:
;检查字符串结束
mov ch,0
mov cl,[si]
jcxz ok
mov ah,[si]
mov es:[bx+si],ah
mov es:[bx+si].1,al
inc si
jmp short colour
ok:
ret
code ends
end start
assume cs:code,ss:stack,ds:data
data segment
db'welcome to masm ',0
data ends
stack segment
dw 16 dup(0)
stack ends
code segment
start:
mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov dh,8
mov dl,3
mov cl,2
mov si,0
mov ax,0b800h
mov es,ax;显示基地指
call show_str
mov ax,4c00h
int 21h
show_str:
mov al,160
mov ah,dh
mul ah
mov bx,ax
mov ah,0
mov al,2
mul dl;一个字符2b 列
add bx,ax;列行实际地址
mov al,cl;颜色储存在al
colour:
;检查字符串结束
mov ch,0
mov cl,[si]
jcxz ok
mov ah,[si]
mov es:[bx],ah
mov es:[bx].1,al
add bx, 2
inc si
jmp short colour
ok:
ret
code ends
end start
改红色部分
|
-
|