Wednesday, March 2, 2016

8051 SWAP Instruction

Swap nibbles within the Accumulator

InstructionSWAP A
FunctionSwap nibbles within the Accumulator
Bytes1
Cycles1
Encoding0 1 0 0 0 1 0 0
OperationA3-0 swap A7-4
DescriptionSWAP A interchanges the low- and high-order nibbles (four-bit fields) of the Accumulator (bits 3 through 0 and bits 7 through 4). The operation can also be thought of as a 4-bit rotate instruction. No flags are affected.
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleThe Accumulator holds the value 0C5H (11000101B). The instruction,
SWAP A
leaves the Accumulator holding the value 5CH (01011100B).
Bytes: Number of bytes required to encode the instruction.
Cycles: Number of instruction cycles required to execute the instruction. Note that there are 12 oscillator cycles to one instruction cycle on a standard 8051.
Encoding: Lists the byte encoding for the instruction.
Operation: Lists, step-by-step, the operations performed by the instruction.
Flags Affected: are highlighted in Bold



Related topics:
8051 Logical Operation Instructions   |   8051 ANL Instruction   |   8051 ORL Instruction   |   8051 XRL Instruction   |   8051 CLR Instruction   |   8051 CPL Instruction   |   8051 RL Instruction   |   8051 RR Instruction   |   8051 RLC Instruction   |   8051 RRC Instruction

List of topics: 8051

No comments:

Post a Comment