Addition of two digit numbers using procedure in Assembly

Bismillahir Rahmanir Rahim
Solution:

if1
includw mylib1.lib
ENDif
data segment
aa dw ?
ba dw ?
ca dw ?
sa dd ?
data ENDS
stack segment
db 100 Dup(0)
stack ENDS
code segment
Assume cs:code, ds:data, ss:stack
start:
 mov ax,seg data
 mov ds,ax
 mov ax,seg stack
 mov ss,ax

 call inum
 mov aa,ax
 call inum
 mov ba,ax
 call inum
 mov ca,ax

 mov ax,aa
 add ax,ba
 add ax,ca
 mov sa,ax
 mov bx,ax
 printd
 mov ah,4C00h
 int 21h

 inum proc
 
 mov ah,01h 
 int 21h
 sub al,30h
 push ax
 
 mov ah,01h
 int 21h
 sub al,30h
 push ax
 
 
 mov BP,SP
 mov dl,10
 mov ax,word ptr [bp+2]
 mul dl

 mov bx, word ptr [bp]
 add al,bl
 mov ah,00
 push ax
 mov ah,02
 mov dl,30h
 int 21h
 pop ax
 pop cx
 pop cx
 
  RET
 inum ENDP

 printfd
code ENDS
END start

Socializer Widget By Blogger Yard
SOCIALIZE IT →
FOLLOW US →
SHARE IT →