Created
February 2, 2016 09:01
-
-
Save abrarShariar/712ae77bdb6787855892 to your computer and use it in GitHub Desktop.
Taking input and storing in variable and displaying them
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 | |
input1 db 'Enter Input[1]: $' ;define variables | |
input2 db 'Enter Input[2]: $' | |
num1 db ? | |
num2 db ? | |
.code | |
main proc | |
mov ax,@data ;prepare data segment | |
mov ds,ax | |
mov ah,09h ;string output | |
lea dx,input1 ;load effective address | |
int 21h | |
mov ah,01h ;input | |
int 21h | |
mov num1,al ;mov to varible | |
mov ah,02h ;char output | |
mov dl,0Ah ;newline | |
int 21h | |
mov dl,0Dh | |
int 21h | |
mov ah,09h ;string output | |
lea dx,input2 ;load effective address | |
int 21h | |
mov ah,01h ;input | |
int 21h | |
mov num2,al ;move to variable | |
mov ah,02h ;output char | |
mov dl,0Ah | |
int 21h | |
mov dl,0Dh ;newline | |
int 21h | |
mov dl,'a' | |
int 21h | |
mov dl,':' | |
int 21h | |
mov dl,num1 ;output num1 | |
int 21h | |
mov dl,0Ah ;newline | |
int 21h | |
mov dl,0Dh | |
int 21h | |
mov dl,'b' | |
int 21h | |
mov dl,':' | |
int 21h | |
mov dl,num2 ;mov dl | |
int 21h | |
mov ah,4ch | |
mov al,00 | |
main endp | |
end main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment