Sunday, September 19, 2010

MASM Programs: Addition of two numbers

.model small
.stack
.data
a db "enter the first number : $"
b db "enter the second number: $"
e db 0ah,0dh,"$"
d db "sum is=$"
.code
.startup
lea dx,a
mov ah,09h
int 21h
mov ah,01h
int 21h
mov bl,al
lea dx,e
mov ah,09h
int 21h
lea dx,b
mov ah,09h
int 21h
mov ah,01h
int 21h
mov ah,00h
add al,bl
aaa
mov bl,al
mov bh,ah
lea dx,e
mov ah,09h
int 21h
lea dx,d
mov ah,09h
int 21h
mov dl,bh
add dl,30h
mov ah,02
int 21h
mov dl,bl
add dl,30h
mov ah,02
int 21h
.exit
end


6 comments:

Anonymous said...

give simple program......

Anonymous said...

Isn't there a simple program .................,,,,??????????????

Rahul padhiyar said...

no its very easy .. hahahah

Nibin Luke Mathew said...

this program is a simple one...and i like it

check this out http://orientar4u.blogspot.in/p/masm-program.html

Anonymous said...

please check this
http://itsourtech.blogspot.in/p/s.html

Geetha Nair said...

it doesnt work for me. :( pls help.. I am new to this. when I run this program I got lot of Garbage symbols and enter the first number: when I enter the number it again shows the same.. :( pls help... thanks in advance..

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes