prnstr macro msg
mov ah, 09h
lea dx, msg
int 21h
endm
data segment
bufo1 db "Enter a string : $"
bufi db 11
db 0
db 11 dup(' ')
bufo2 db 0ah, "You entered : $"
data ends
code segment
assume cs:code, ds:data
start :
mov ax, data
mov ds, ax
prnstr bufo1
mov ah, 0ah
lea dx, bufi
int 21h
mov si, offset bufi + 1
mov cx, 0000h
mov cl, byte ptr [si]
add si, cx
mov byte ptr [si+1], '$'
prnstr bufo2
prnstr bufi+2
mov ax, 4c00h
int 21h
code ends
end start