dos 调用显示覆盖了输入回显?新手

dos 调用显示覆盖了输入回显?新手求救
Assembly code

data segment
string db 255 dup(?),'$'
data ends
code segment
    assume cs:code,ds:data
start:
    mov ax,data
    mov ds,ax
    lea dx,string
    mov di,dx
    mov byte ptr [di],0ffh

    mov ah,0ah
    int 21h
    mov ax,[di+1]
    and ax,0ffh
    mov si,ax
    mov byte ptr [3+si],'$'
    add dx,2
    mov ah,09h
    int 21h 
    mov ah,4ch
    int 21h

code ends
    end start


要求:使用DOS调用0A 输入字串,然后使用 09 显示

遇到问题:显示覆盖了输入回显,可是为什么呢?

------解决方案--------------------
加个换行