beautypg.com

41 div2 (correction when remainder is 0), Div2 (correction when remainder is 0) – FUJITSU FR family 32-bit microcontroller instruction manuel CM71-00101-5E User Manual

Page 158

background image

134

CHAPTER 7 DETAILED EXECUTION INSTRUCTIONS

7.41

DIV2 (Correction when Remainder is 0)

This instruction is used in signed division. It should be used in combinations such as
DIV0S, DIV1 x 32, DIV2, DIV3 and DIV4S.

DIV2 (Correction when Remainder is 0)

Assembler format:

DIV2 Ri

Operation:

if (D1 = = 1) {

MDH + Ri

temp

}
else {

MDH – Ri

temp

}
if (Z == 1) {

0

MDH

}

Flag change:

N and V: Unchanged

Z: Set when the operation result of stepwise division is "0", cleared otherwise. Set according to

remainder of division results, not according to quotient.

C: Set when the result of stepwise division involves a carry or borrow operation, cleared otherwise.

Execution cycles:

1 cycle

Instruction format:

N

Z

V

C

C

C

MSB

LSB

1

0

0

1

0

1

1

1

0

1

1

1

Ri