beautypg.com

Zilog Z8F0130 User Manual

Page 253

background image

eZ8

CPU Core

User Manual

UM012820-0810

SWAP Instruction

238

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 Register

BCh

contains the value

B3h

(

10110011b

), the following state-

ment leaves the value

3Bh

(

00111011b

) in Register

BCh

and clears the Z

and S flags:

SWAP BCh

Object Code: F0 BC

If Working Register R5 contains the value

BCh

and Register

BCh

contains

the value

B3h

(

10110011b

), the following statement leaves the value

3Bh

(

00111011b

) in Register

BCh

and clears the Z and S flags:

SWAP @R5h

Object Code: F1 E5