马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
根据dh中给的行号,dl中给的列号,cl中给出的样式来把data中的字符串输出到屏幕上;代码如下:
assume cs:code
data segment
db 'welcome to masm!',0
data ends
code segment
start: mov dh,8
mov dl,3
mov cl,2
mov ax,data
mov ds,ax
mov si,0
call show_str
mov ax,4c00h
int 21h
show_str:
mov ax,0b800h
mov es,ax
mov ch,0
mov bx,cx ;sava cx value to bx
mov al,0a0h
mul dh ;address of row in ax
add dl,dl ;address of column in dl
mov dh,0
add ax,dx
mov bp,ax
mov ch,0
s: mov cl,[si]
jcxz re ;Is the value in [si] zero
mov es:[bp],cl
mov es:[bp+1],bl
inc si
add bp,2
inc cx
loop s
re: ret
code ends
end start
|