Wednesday, March 23, 2016

8051 Exchange Digit

XCHD exchanges the low-order nibble of the Accumulator (bits 3 through 0), generally representing a hexadecimal or BCD digit, with that of the internal RAM location indirectly addressed by the specified register. The high-order nibbles (bits 7-4) of each register are not affected. No flags are affected.

Encoding: 1 1 0 1 0 1 1 i

R0 contains the address 20H. The Accumulator holds the value 36H (00110110B). Internal RAM location 20H holds the value 75H (01110101B). The following instruction,


leaves RAM location 20H holding the value 76H (01110110B) and 35H (00110101B) in the Accumulator

Related topics:
8051 Complement Accumulator and Bit   |   8051 Set Bit   |   8051 Clear Accumulator and Bit   |   8051 Rotate Accumulator   |   8051 Swap Nibble   |   8051 Exchange Accumulator   |   8051 Push and Pop   |   8051 No Operation

List of topics: 8051

No comments:

Post a Comment