8086 asm 中的结构类型数据无法打印

the struc type data in 8086asm can not print

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读取一个字符串,字符串returned包括回车return(0dh)

所以使用

mov bl, [x+1] 
mov bh, 0 
mov [x+2+bx], '$'