Skip to content

Instantly share code, notes, and snippets.

@prodhan
Created May 5, 2019 14:51
Show Gist options
  • Save prodhan/740fda07290280e01f0d6e55736e0c52 to your computer and use it in GitHub Desktop.
Save prodhan/740fda07290280e01f0d6e55736e0c52 to your computer and use it in GitHub Desktop.
; Add two number by taking input
; You may customize this and other start-up templates;
; The location of this template is c:\emu8086\inc\0_com_template.txt
org 100h
;print msg
mov ah,09H
mov dx,offset mes1
int 21h
;input
MOV AH,1
INT 21H
MOV bl,al
;new line
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
;message print
mov ah,09H
mov dx,offset mes2
int 21h
;input
mov ah,1
int 21H
mov cl,al
;new line
mov ah,2
mov dl,0dh
int 21h
mov dl,0ah
int 21h
;message print
mov ah,09H
mov dx,offset mes3
int 21h
;add
add bl,cl
mov dl,bl
sub dl,30H
;output
mov ah,2
int 21H
ret
;message
mes1 DB "First input $"
mes2 DB "Second input $"
mes3 DB "Output $"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment