Created
April 19, 2016 07:51
-
-
Save ehzawad/546f9c6513f8a0b273a8e3abbf41f112 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 100 | |
| .data | |
| main proc | |
| mov cx, 0 | |
| mov cl, 0 | |
| pushing: | |
| mov ah, 1 | |
| int 21h | |
| mov bl, al | |
| cmp bl, 0dh | |
| je newline | |
| cmp bl, 61h | |
| je increment | |
| push bx | |
| inc cx | |
| jmp pushing | |
| increment: | |
| inc cl | |
| push bx | |
| inc cx | |
| jmp pushing | |
| newline: | |
| mov ah, 2 | |
| mov dl, 0dh | |
| int 21h | |
| mov dl, 0ah | |
| int 21h | |
| poping: | |
| pop dx | |
| int 21h | |
| loop poping | |
| exit: | |
| mov ah, 2 | |
| mov dl, 0dh | |
| int 21h | |
| mov dl, 0ah | |
| int 21h | |
| mov dl, bl | |
| int 21h | |
| main endp | |
| end main | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment