Wednesday, March 2, 2016

8051 ORL Instruction

Logical OR

InstructionORL dest-byte,src-byte
FunctionLogical-OR for byte variables
DescriptionORL performs the bitwise logical-OR operation between the indicated variables, storing the results in the destination byte. 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 (11000011B) and R0 holds 55H (01010101B) then the following instruction,
ORL A,R0
leaves the Accumulator holding the value 0D7H (1101011lB).When the destination is a directly addressed byte, the instruction can set combinations of bits in any RAM location or hardware register. The pattern of bits to be set is determined by a mask byte, which may be either a constant data value in the instruction or a variable computed in the Accumulator at run-time. The instruction,
ORL P1,#00110010B
sets bits 5, 4, and 1 of output Port 1.
VariantsORL A,Rn
ORL A,direct address
ORL A,@Ri
ORL A,#immediate data
ORL direct address,A
ORL direct address, #immediate data

InstructionORL A,Rn
Bytes1
Cycles1
Encoding0 1 0 0 1 n n n
OperationA = A OR Rn
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleORL 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

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

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

InstructionORL A,#immediate data
Bytes2
Cycles1
Encoding0 1 0 0 0 1 0 0 D7...D0
OperationA = A OR immediate data
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleORL 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

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

InstructionORL direct address, #immediate data
Bytes3
Cycles2
Encoding0 1 0 0 0 0 1 1 A7...A0 D7...D0
Operation(direct address) = (direct address) OR immediate data
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleORL 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

InstructionORL C,src-bit
FunctionLogical-OR for bit variables
DescriptionSet the carry flag if the Boolean value is a logical 1; leave the carry in its current state otherwise. A slash ( / ) preceding the operand in the assembly language indicates that the logical complement of the addressed bit is used as the source value, but the source bit itself is not affected. No other flags are affected.
ExampleSet the carry flag if and only if P1.0 = 1, ACC. 7 = 1, or OV = 0:
MOV C,P1.0 ;LOAD CARRY WITH INPUT PIN P10
ORL C,ACC.7 ;OR CARRY WITH THE ACC. BIT 7
ORL C,/OV ;OR CARRY WITH THE INVERSE OF OV.
VariantsORL C,bit
ORL C,/bit

InstructionORL C,bit
Bytes2
Cycles2
Encoding01110010 bit_address
OperationC = C OR (bit)
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleORL C, 22h
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

InstructionORL C,/bit
Bytes2
Cycles2
Encoding1 0 1 0 0 0 0 0 bit_address
OperationC = C OR NOT (bit)
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleORL C, /22h
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 XRL 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