views:

45

answers:

1

Hi,

I am learning assembly language.

Is there modulus operator in assembly? I know I can find the remainder using the formula Number= Divident * Divisor + Remainder.

I have heard when we use the DIV syntax the remainder is stored in one of the register?

Edit 1 : I am using Intel x86 Architecture and devloping it on Ubuntu.

Thanks.

+3  A: 

The DIV instruction returns the quotient in AX and the remainder in DX, on the x86 architecture.

Delan Azabani
+1 Thanks a lot.
Searock
No problem, happy to help.
Delan Azabani