modsd
Modulo Signed Doubleword
Calculates remainder of signed doubleword division.
Details
The 64-bit dividend is (RA). The 64-bit divisor is (RB). The 64-bit remainder of the dividend divided by the divisor is placed into register RT. The quotient is not supplied as a result. Both operands and the remainder are interpreted as signed integers. The remainder is the unique signed integer that satisfies remainder = dividend - (quotient × divisor) where 0 ≤remainder < |divisor| if the dividend is nonnegative, and -|divisor| < remainder ≤0 if the dividend is negative.
Pseudocode Operation
dividend ← (RA)
divisor ← (RB)
RT ← dividend % divisor
Programming Note
If an attempt is made to perform any of the divisions
Example
Encoding
Operands
-
RT
Target -
RA
Dividend -
RB
Divisor