This file contains 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
.model small | |
.stack 100h | |
.data | |
a db ? | |
.code | |
main proc | |
mov ax, @data | |
mov ds, ax | |
input: | |
mov ah, 1 | |
int 21h | |
;caution without al register variable cannot hold value | |
mov a, al | |
cmp a, 'X' | |
je exit | |
output: | |
mov ah, 2 | |
mov dl, 0ah | |
int 21h | |
mov dl, 0dh | |
int 21h | |
mov dl,a | |
int 21h | |
mov dl, 0ah | |
int 21h | |
mov dl, 0dh | |
int 21h | |
;nonconditional jump | |
jmp input | |
exit: | |
; successful termination | |
mov dl, 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