Crossware

Table of Contents        Previous topic       Next topic       

MICROPROCESSOR INSTRUCTION REFERENCE->DIVS

DIVS    Signed Divide

Compatibility:    Starting with 5206e.

Destination/Source -> Destination
    
Assembler Syntax:DIVS.W <ea>,Dn32/16 -> 16r:16q
DIVS.L <ea>,Dq 32/32 -> 32q
Size:    Word, Long

For word size, divides the 32 bit signed destination operand by the 16 bit signed source operand and stores the 16 signed quotient and the 16 bit signed remainder result in the destination.  The quotient is stored in the lower word of the destination and the remainder is stored in the upper word of the destination.  An overflow occurs is the quotient is larger than a 16 bit signed integer.

For long size, divides the 32 bit signed destination operand by the 32 bit signed source operand and stores the 32 signed quotient in the destination. An overflow occurs is the quotient is larger than a 32 bit signed integer.

Division by zero causes a divide-by-zero exception with the exception stack frame pointing to the faulting DIVS instruction.

Condition Codes:
    
N    Cleared if overflow detected, else set if quotient is negative and cleared if quotient is positive
Z    Cleared if overflow detected, else set if quotient is zero and cleared if quotient is nonzero
V    Set if overflow, else cleared
C    Always cleared
X    Not affected

    
Allowable Addressing Modes
    
DIVS.WDn,DnDIVS.LDn,Dn
DIVS.W(An),Dn DIVS.L(An),Dn
DIVS.W(An)+,DnDIVS.L(An)+,Dn
DIVS.W-(An),DnDIVS.L-(An),Dn
DIVS.W(d16,An),DnDIVS.L(d16,An),Dn
DIVS.W(d8,An,Xn),Dn
DIVS.W(xxx).L,Dn
DIVS.W(xxx).L,Dn
DIVS.W#<data>,Dn
DIVS.W(d16,PC),Dn
DIVS.W(d8,An,Xn),Dn