Created
February 6, 2016 19:03
-
-
Save abrarShariar/1c62c1623bcd757b6fc1 to your computer and use it in GitHub Desktop.
take input char and increment by 1 in a loop
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
;take input char and increment by 1 in a loop | |
.model small | |
.stack 100h | |
.data | |
a db ? | |
text db 'THE END $' | |
.code | |
main proc | |
mov ax,@data | |
mov ds,ax | |
LOOP: mov ah,01 | |
int 21h | |
mov a,al | |
inc a ;increment by 1 | |
mov ah,02 ;output | |
mov dl,a | |
int 21h | |
mov ah,01 ;input | |
int 21h | |
cmp al, 0Dh | |
je LOOP | |
jmp END | |
END: mov ah,09 ;string output | |
lea dx,text | |
int 21h | |
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