Intel 8XC251SQ, 8XC251SA XCH A,byte, XCH A,@R0, Binary Mode = Encoding Source Mode = Encoding

Models: Embedded Microcontroller 8XC251SP 8XC251SA 8XC251SQ 8XC251SB

1 458
Download 458 pages 25.38 Kb
Page 382
Image 382

8XC251SA, SB, SP, SQ USER’S MANUAL

 

Binary Mode

Source Mode

Bytes:

2

1

States (2 bytes):

11

10

States (4 bytes):

16

15

[Encoding]

1 0 1 1

1 0 0 1

Hex Code in: Binary Mode = [A5][Encoding]

Source Mode = [Encoding]

Operation: TRAP

SP SP – 2

(SP) PC

PC (0FF007BH)

XCH A,<byte>

Function: Exchange accumulator with byte variable

Description: Loads the accumulator with the contents of the specified variable, at the same time writing the original accumulator contents to the specified variable. The source/destination operand can use register, direct, or register-indirect addressing.

Flags:

CY

AC

OV

N

Z

 

 

 

 

 

 

 

 

 

 

Example: R0 contains the address 20H, the accumulator contains 3FH (00111111B) and on-chip RAM location 20H contains 75H (01110101B). After executing the instruction

XCH A,@R0

RAM location 20H contains 3FH (00111111B) and the accumulator contains 75H (01110101B).

Variations

XCH A,dir8

Binary Mode Source Mode

Bytes:

States:

[Encoding]

Hex Code in:

Operation:

 

2

 

2

 

 

 

 

3†

3†

†If this instruction addresses a port (Px, x = 0–3), add 2 states.

 

 

 

 

 

 

1 1 0 0

 

0 1 0 1

 

 

direct addr

 

 

 

 

 

 

 

 

Binary Mode = [Encoding]

Source Mode = [Encoding]

XCH

(A) → ← (dir8)

A-130

Page 382
Image 382
Intel 8XC251SQ, 8XC251SA, 8XC251SP, 8XC251SB manual XCH A,byte, XCH A,@R0, Binary Mode = Encoding Source Mode = Encoding