Created
March 15, 2020 04:12
-
-
Save abue-ammar/e72696b929abb71ccb6f5aa6f37939ea to your computer and use it in GitHub Desktop.
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
| .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