Display each character next line in Reverse Order

.model small

.stack 100h

.data
str db "DEEPRAJ$"

.code
start:
    mov ax,@data
    mov ds,ax
    mov cx,0
    lea si,str
l2: cmp [si],'$'
    je l1
    inc cx
    inc si
    jmp l2
l1: dec si
    mov dl,[si]
    mov ah,2
    int 21h
    mov dl,10
    mov ah,2
    int 21h
    loop l1
    mov ah,4ch
    int 21h
end start
end

OUTPUT

No comments:

Post a Comment