CHAPTER 6 DETAILED RULES FOR EXECUTION INSTRUCTIONS

 

Execution example : DAA

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Memory

 

FFFFH

 

 

 

 

 

 

Memory

 

FFFFH

A

XX

4A

 

 

 

 

 

 

 

A

XX

50

 

 

 

 

 

 

 

T

 

 

 

 

 

 

 

 

 

T

 

 

 

 

 

 

 

 

 

IX

 

 

 

 

 

 

 

 

 

IX

 

 

 

 

 

 

 

 

 

SP

 

 

 

 

 

 

 

 

 

SP

 

 

 

 

 

 

 

 

 

PC

 

 

 

 

 

 

 

 

 

PC

 

 

 

 

 

 

 

 

 

EP

 

 

 

 

 

Byte

 

0000H

 

EP

 

 

 

 

 

Byte

 

0000H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

H

I

IL1

IL0

N

Z

V

C

 

 

H

I

IL1

IL0

N

Z

V

C

PS

 

0 0 1 1 0 0 0 0

PS

 

0 0 1 1 0 0 0 0

 

Byte

 

 

 

Byte

 

 

 

 

Byte

 

 

 

Byte

 

 

 

 

 

 

 

 

(Before execution)

 

 

 

 

 

(After execution)

Table 6.26-1 Decimal Adjustment Table (DAA)

C-flag

AL

H-flag

AL

Correction

C-flag after

 

(bit7 to bit4)

 

(bit3 to bit0)

value

execution

 

 

 

 

 

 

0

0 to 9

0

0 to 9

00

0

0

0 to 8

0

A to F

06

0

0

0 to 9

1

0 to 3

06

0

0

A to F

0

0 to 9

60

1

0

9 to F

0

A to F

66

1

0

A to F

1

0 to 3

66

1

1

0 to 2

0

0 to 9

60

1

1

0 to 2

0

A to F

66

1

1

0 to 3

1

0 to 3

66

1

 

 

 

 

 

 

Table 6.26-2 Execution Example

Mnemonic

AL

C

H

 

 

 

 

MOV A, #75H

75

0

 

 

 

 

ADDC A, #25H

9A

0

0

 

 

 

 

DAA

00

1

0

 

 

 

 

99

Page 111
Image 111
Fujitsu F2MC-8FX manual Decimal Adjustment Table DAA, Execution Example