|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code
data segment
db 'Welcome to masm!',0
data ends
stack segment
dw 0,0,0,0,0,0,0,0
stack ends
code segment
start:
mov dh,8
mov dl,3
mov cl,2
mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,16
mov si,0
call show_str
mov ax,4c00h
int 21h
show_str:
push cx
push dx
push ss
push si
push sp
push di
mov bx,0
mov bl,dl
mov di,bx
mov ax,0
mov al,0a0h
mul dh
mov bp,ax
mov ax,0b800h
mov es,ax
go:
mov bl,cl
mov cl,[si]
mov ch,0
jcxz ok
mov cl,bl
mov bl,[si]
mov es:[bp+di],bl
add di,1
mov es:[bp+di],cl
add di,1
add si,1
jmp short go
ok:
pop di
pop sp
pop si
pop ss
pop dx
pop cx
ret
code ends
end start
为什么,没有显示 Welcome to masm!,蓝色
debug时,没有进行add bp,1
mov es:[bp+di],cl
add bp,1
add si,1
直接jmp 了 |
|