I'm using Emu 8086 to code the work: Enter a string and print it.
But I don't know why the program doesn't print the right string I entered. Example, when I enter: "123456789", the result is "d (tab) 123456789". I think because I declared variable x is "100,?,101 dup('$')", therefore 'd' is corresponding to 100 in ascii. And tab is corresponding to 9 (the number of characters I entered) in ascii.
Here is my code:
.model small
.stack 100h
.data
x db 100,?,101 dup('$')
tab db 10,13,'$'
.code
main proc
mov ax, @data
mov ds, ax
mov ah, 10
lea dx, x
int 21h
mov ah, 9
lea dx, tab
int 21h
mov ah, 9
lea dx, x
int 21h
mov ah, 4ch
int 21h
main endp
end main
Can anyone explain this problem? Thank you!