beautypg.com

Zilog Z8F0130 User Manual

Page 145

background image

eZ8

CPU Core

User Manual

UM012820-0810

CPX Instruction

130

Attributes

Escaped Mode Addressing

Using Escaped Mode Addressing, address mode ER for the source or des-
tination can specify a working register with 4-bit addressing.

If the high byte of the source or destination address is

EEh

(

11101110b

),

a working register is inferred. For example, the operand

EE3h

selects

Working Register R3. The full 12-bit address is provided by

{RP[3:0],

RP[7:4], 3h}

.

To access registers on Page

Eh

(addresses

E00h

to

EFFh

), set the Page

Pointer, RP[3:0], to

Eh

and set the Working Group Pointer,

RP[7:4]

, to

the preferred Working Group.

Sample Usage

If Register

AB3h

contains

16h

and Register

911h

contains

20h

, the fol-

lowing statement sets the C and S flags, and clears the Z and V flags:

CPX %AB3, %911

Object Code: A8 3B

If Register

26Ch

contains

2Ah

, the following statement sets the Z flag,

and clears the C, S, and V flags:

CPX 26Ch, #2Ah

Object Code: A9 6C 2A

Mnemonic

Destination,
Source

Op
Code
(Hex)

Operand 1 Operand 2 Operand 3

CPX

ER1, ER2

A8

ER2[11:4]

{ER2[3:0],
ER1[11:8]}

ER1[7:0]

CPX

ER1, IM

A9

IM

{0h,
ER1[11:8]}

ER1[7:0]