实验十.编写子程序(1)显示字符串
根据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,
jcxz re ;Is the value in zero
mov es:,cl
mov es:,bl
inc si
add bp,2
inc cx
loop s
re: ret
code ends
end start
页:
[1]