beautypg.com

Zilog Z8F0130 User Manual

Page 148

background image

eZ8

CPU Core

User Manual

UM012820-0810

DA Instruction

133

Attributes

Escaped Mode Addressing

Using Escaped Mode Addressing, address modes R or IR can specify a
working register. If the destination address is prefixed by

Eh

(

1110b

), a

working register is inferred. For example, if Working Register R12 (

Ch

) is

the preferred destination operand, use

ECh

as the destination operand in

the Op Code. To access registers with addresses

E0h

to

EFh

, either set the

Working Group Pointer,

RP[7:4]

, to

Eh

or use indirect addressing.

Sample Usage

If addition is performed using the BCD value 15 and 27, the result should
be 42. The sum is incorrect, however, when the binary representations are
added in the destination location using standard binary arithmetic.

If the result of the addition is stored in Register

5Fh

, the following state-

ment adjusts this result to obtain the correct BCD representation.

DA 5Fh

Object C?de: 40 5F

Mnemonic Destination

Op
Code
(Hex)

Operand 1 Operand 2 Operand 3

DA

R1

40

R1

DA

@R1

41

R1

0001 0101 = 15h

0010 0111 = 27h

0011 1100 = 3Ch