Skip to content

Instantly share code, notes, and snippets.

@abue-ammar
Created March 15, 2020 04:12
Show Gist options
  • Select an option

  • Save abue-ammar/e72696b929abb71ccb6f5aa6f37939ea to your computer and use it in GitHub Desktop.

Select an option

Save abue-ammar/e72696b929abb71ccb6f5aa6f37939ea to your computer and use it in GitHub Desktop.
.model small
.stack 100h
.data
msg db 0ah,0dh,'$'
.code
main proc
mov ax,@data
mov ds,ax
mov cl,0
top:
mov ah,1
int 21h
cmp al,0dh
je input
push ax
inc cl
jmp top
input:
mov ah,9
lea dx,msg
int 21h
output:
cmp cl,0
je eoutput
mov ah,2
pop bx
mov dx,bx
int 21h
dec cl
jmp output
eoutput:
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