Assembly Program to Divide 2 Integers

include irvine32.inc
.data
msg  byte " This Program will Divide 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 10
num2 word 5

.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
mov bx,num2
mov dx,0
div bx
call writeint
call crlf

exit
main endp
end main


No comments

Powered by Blogger.