;==================Prompts===============
warning db "Invalid order. The dividend should be greater than the divisor",0
prompt1 db 0dh,0ah,"Please enter a dividend ",0
prompt2 db 0dh,0ah,"Please enter a divisor ",0
Display db 0dh,0ah,"Quotient: ",0
Display2 db 0dh,0ah,"Remainder: ",0
;==================Variables=============
dividend word ? ; Holds the dividend
divisor word ? ; Holds the divisor
quotient word ? ; Holds the quotient
Remain word ? ; Holds the remainder
;==================Main==================
.code
main PROC
.startup
mov dx, offset prompt1
call writestring
call readint
mov dividend, ax
mov dx, offset prompt2
call writestring
call readint
mov divisor, bx
CWD
div bx
mov quotient, ax
mov dx, offset Display
call writestring
call writeint
exit
main ENDP
END main
Let me start by saying the I'm a complete greenhorn when it comes to assembly. My professor seems to think it's a good idea to give us a crash course before our final but anyway. The program gets the dividend and divisor correctly but for some reason div bx
ax/bx gives me an error when I have 10 in ax and 2 in bx. Why is that.
This is driving me up the wall because I did the exact same thing I did in another program and it worked.