.model small
.data
str1 db 'sanjay', '$'
str1_len dw $-str1
str2 db ?
.code
begin:
mov ax, @data
mov ds, ax
mov es, di
lea si, str1
lea di, str2
mov ax, str1_len
sub ax, 01h
add ax, si
mov si, ax
mov ax, str1_len
sub ax, 01h
add ax, di
mov di, ax
mov cx, str1_len
std
counter:
mov ax, [si]
mov [di], ax
dec di
dec si
loop counter
cld
mov ah, 09h
lea dx, str2
int 21h
mov ax, 4c00h
int 21h
.exit
end begin