outputstring macro x
push ax
push dx
mov ah,9
mov dx,offset x
int 21h ;
pop dx
pop ax
endm
inputstring macro x
push ax
push dx
mov ah,0ah
mov dx,offset x
int 21h ;
pop dx
pop ax
endm
display struc ;struc
ex1 db 20,0,20 dup('$') ;ex1
display ends
assume cs:code,ds:data
data segment
stu_temp display<>
question db "please input a string:",'$'
data ends
code segment
start:
mov ax,data
mov ds,ax
outputstring question
inputstring stu_temp.ex1
call next_line
outputstring stu_temp.ex1+2
mov ah,2
mov dl,9
int 21h ;ascii(9)=tab
outputstring stu_temp.ex1+2
mov ah,2
mov dl,9
int 21h ;ascii(9)=tab
outputstring stu_temp.ex1+2
mov ax,4c00h
int 21h
next_line:
push dx
push ax
mov dl,0dh
mov ah,2
int 21h
mov dl,0ah
int 21h
pop ax
pop dx
ret
code ends
end start
我认为结果应该是
xxxxx(您的输入)“tab”xxxxx(您的输入)“tab”xxxxx(您的输入)
例如,
输入感谢,
它应该输出“谢谢谢谢谢谢”
但我得到了这个
我困惑了2天
这个问题的解决办法是什么?任何帮助表示赞赏
这个问题的解决办法是什么?任何帮助表示赞赏
就像@Michael Petch 说的,
Int 21h/ah=0ah
读取一个字符串,返回的字符串包含回车符(0dh)
So use
mov bl, [x+1]
mov bh, 0
mov [x+2+bx], '$'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)