Assembly Program to Subtract two integers

include irvine32.inc
.data
msg  byte " This Program Subtract 2 Integer numbers: ",0,13h,10h
msg2 byte " First No is  =  ",0
msg3 byte " Second No is =  ",0
msg4 byte " Result is equal to  =  ",0
num1 word 110
num2 word 20

.code
main proc
call clrscr
mov edx,offset msg
call writestring
call crlf

call crlf
mov edx,offset msg2
call writestring
mov ax,num1
call writeint
call crlf

mov edx,offset msg3
call writestring
mov ax,num2
call writeint
call crlf

call crlf
mov edx,offset msg4
call writestring
mov ax,num1
sub ax,num2
call writeint
call crlf

exit
main endp
end main


No comments

Powered by Blogger.