Skip to content

Instantly share code, notes, and snippets.

@ehzawad
Created February 7, 2016 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehzawad/51c5acace1b4c3e166d2 to your computer and use it in GitHub Desktop.
Save ehzawad/51c5acace1b4c3e166d2 to your computer and use it in GitHub Desktop.
.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