Wednesday, March 2, 2016

8051 XRL Instruction

Logical Exclusive-OR

InstructionXRL dest-byte,src-byte
FunctionLogical Exclusive-OR for byte variables
DescriptionXRL performs the bitwise logical Exclusive-OR operation between the indicated variables, storing the results in the destination. No flags are affected.
The two operands allow six addressing mode combinations. When the destination is the Accumulator, the source can use register, direct, register-indirect, or immediate addressing; when the destination is a direct address, the source can be the Accumulator or immediate data.
Note: When this instruction is used to modify an output port, the value used as the original port data is read from the output data latch, not the input pins.
ExampleIf the Accumulator holds 0C3H (1100001lB) and register 0 holds 0AAH (10101010B) then the instruction,
XRL A,R0
leaves the Accumulator holding the value 69H (01101001B).
When the destination is a directly addressed byte, this instruction can complement combinations of bits in any RAM location or hardware register. The pattern of bits to be complemented is then determined by a mask byte, either a constant contained in the instruction or a variable computed in the Accumulator at run-time. The following instruction,
XRL P1,#00110001B
complements bits 5, 4, and 0 of output Port 1.
VariantsXRL A,Rn
XRL A,direct address
XRL A,@Ri
XRL A,#immediate data
XRL direct address,A
XRL direct address, #immediate data

InstructionXRL A,Rn
Bytes1
Cycles1
Encoding0 1 1 0 1 n n n
OperationA = A XOR Rn
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleXRL A, R4
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

InstructionXRL A,direct address
Bytes2
Cycles1
Encoding0 1 1 0 0 1 0 1 A7...A0
OperationA = A XOR (direct address)
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleXRL A, 40h
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

InstructionXRL A,@Ri
Bytes1
Cycles1
Encoding0 1 1 0 0 1 1 i
OperationA = A XOR (Ri)
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleXRL A, @R0
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

InstructionXRL A,#immediate data
Bytes2
Cycles1
Encoding0 1 1 0 0 1 0 0 D7...D0
OperationA = A XOR immediate data
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleXRL A, #3Fh
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

InstructionXRL direct address,A
Bytes2
Cycles1
Encoding0 1 1 0 0 0 1 0 A7...A0
Operation(direct address) = (direct address) XOR A
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleXRL 40h, A
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

InstructionXRL direct address, #immediate data
Bytes3
Cycles2
Encoding0 1 1 0 0 0 1 1 A7...A0 D7...D0
Operation(direct address) = (direct address) XOR immediate data
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleXRL 30h, #77h
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 CLR Instruction   |   8051 CPL Instruction   |   8051 RL Instruction   |   8051 RR Instruction   |   8051 RLC Instruction   |   8051 RRC Instruction   |   8051 SWAP Instruction

List of topics: 8051

No comments:

Post a Comment