title reverse the given string
dosseg
.model small
.stack 100h
.code
main proc
mov ax, @data
mov ds, ax
mov si, offset string ;load base address of string in si register
mov cx, len ;move length in cx register
add si, cx ;character incrementing ie SI=SI+CX, one character beyond string
dec si
BACK: mov dl, [si] ;display character
mov ah, 2
int 21h
dec si ;decrementing address pointer
loop BACK
mov ax, 4c00h
int 21h
main endp
.data
string db ‘This is an ALP’
len dw $-string
end main