MASM program using Irvine library that asks the user to input two numbers and finds the sum.
we used : call writestring, call readint , call writeint
code:
; By Gaith Albadarin
;Adding Two numbers
include irvine32.inc
.data
Num1 db ?
Num2 db 0
str1 db "Enter first Number : ", 10, 13, 0
str2 db "Enter Second Number : " , 0ah, 0dh, 0
str3 db 'Sum = '
.code
main proc
mov edx, offset str1
call writestring
call readint
mov Num1,al
mov edx, offset str2
call writestring
call readint
mov Num2,al
add al, Num1
mov edx, offset str3
call writestring
call writeint
exit
main endp
end main