Created
February 6, 2016 20:21
-
-
Save abrarShariar/877d1ecfdd52fe8eddfd to your computer and use it in GitHub Desktop.
store input char in array and print in reverse way using [DI]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;store input char in array and print in reverse way using [DI] | |
.model small | |
.stack 100h | |
.data | |
arr db ?,?,?,?,? | |
.code | |
main proc | |
mov ax,@data | |
mov ds,ax | |
INPUT: mov ah,01 ;input | |
int 21h | |
mov arr[DI],al | |
inc DI | |
cmp DI,5 ;check | |
je TAB | |
jmp INPUT | |
TAB: mov ah,02 | |
mov dl,09h ;print tab | |
int 21h | |
jmp OUTPUT | |
OUTPUT: dec DI | |
mov ah,02 | |
mov dl,arr[DI] | |
int 21h | |
cmp DI,0 ;check | |
je END | |
jmp OUTPUT | |
END: mov ah,4ch | |
int 21h | |
main endp | |
end main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment