DIV

Signed division

DIV

DIVide


[Syntax]

DIV src, dest

 

[Operation]

dest = dest / src;

 

[Function]

-

This instruction divides dest by src as signed values and places the quotient in dest. The quotient is rounded towards 0.

-

The calculation is performed in 32 bits and the result is placed in 32 bits.

-

The value of dest is undefined when the divisor (src) is 0 or when overflow is generated after the operation.

 

[Instruction Format]

Syntax

Processng Size

src

dest

Code size

(Byte)

DIV src, dest

L

#SIMM:8

Rd

4

L

#SIMM:16

Rd

5

L

#SIMM:24

Rd

6

L

#IMM:32

Rd

7

L

Rs

Rd

3

L

[Rs].memex

Rd

3(memex == UB)

4(memex != UB)

L

dsp:8[Rs].memex

Rd

4(memex == UB)

5(memex != UB)

L

dsp:16[Rs].memex

Rd

5(memex == UB)

6(memex != UB)

[Flag Change]

Flag

C

Z

S

O

Change

 

Conditions

O : This flag is set if the divisor (src) is 0 or the calculation is -2147483648 / -1; otherwise it is cleared.

 

[Description Example]

DIV #10, R2

DIV R1, R2

DIV [R1], R2

DIV 3[R1].B, R2