Skip to content

Instantly share code, notes, and snippets.

@abrarShariar
Created January 31, 2016 12:22
Show Gist options
  • Save abrarShariar/17d7e87da1d3d4683ce1 to your computer and use it in GitHub Desktop.
Save abrarShariar/17d7e87da1d3d4683ce1 to your computer and use it in GitHub Desktop.
Assembly code
.model small
.stack 100h
.data
first dw 'Enter 1st Input: $'
second dw 'Enter 2nd Input: $'
dis dw 'Display:$'
a db ?
b db ?
.code
main proc
mov ax,@data
mov ds,ax
mov ah,9 ;string output
lea dx,first
int 21h
;first input
mov ah,1 ;input
int 21h
mov a,al
;newline
mov ah,2
mov dl,0Ah
int 21h
mov dl,0Dh
int 21h
mov ah,9 ;string output
lea dx,second
int 21h
mov ah,1 ;input
int 21h
mov b,al
;input second
;newline
mov ah,2
mov dl,0Ah
int 21h
mov dl,0Dh
int 21h
mov ah,9
lea dx,dis
int 21h
;newline
mov ah,2
mov dl,0Ah
int 21h
mov dl,0Dh
int 21h
mov dl,'a'
int 21h
mov dl,':'
int 21h
mov dl,a
int 21h
;newline
mov dl,0Ah
int 21h
mov dl,0Dh
int 21h
mov dl,'b'
int 21h
mov dl,':'
int 21h
mov dl,b
int 21h
main endp
end main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment