ALP to reverse the given string

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

Ekendra Lamsal: An Engineer, Technocrat, ICT4D Advocate & Web analyst. Blogging since 2001 (on this site from 2004) in various weblogs. Also, in love with Clouds, Internet of Things, Knowledge Management, Web Inclusion & BI.