Monday, February 29, 2016

8051 JBC Instruction

Jump if Bit is set and Clear bit

InstructionJBC bit, relative address
FunctionJump if Bit is set and Clear bit
Bytes3
Cycles2
Encoding0 0 0 1 0 0 0 0 bit_address A7...A0
OperationPC = PC + 3
IF (bit) = 1
(bit) = 0
PC = PC + relative address
DescriptionIf the indicated bit is one, JBC branches to the address indicated; otherwise, it proceeds with the next instruction. The bit will not be cleared if it is already a zero. The branch destination is computed by adding the signed relative-displacement in the third instruction byte to the PC, after incrementing the PC to the first byte of the next instruction. No flags are affected.
Note: When this instruction is used to test an output pin, the value used as the original data will be read from the output data latch, not the input pin.
Flags AffectedC AC F0 RS1 RS0 OV P
ExampleThe Accumulator holds 56H (01010110B). The following instruction sequence,
JBC ACC.3,LABEL1
JBC ACC.2,LABEL2
causes program execution to continue at the instruction identified by the label LABEL2, with the Accumulator modified to 52H (01010010B).
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 Boolean Variable Manipulation Instructions   |   8051 CPL Instruction   |   8051 CLR Instruction   |   8051 SETB Instruction   |   8051 ORL Instruction   |   8051 ANL Instruction   |   8051 MOV Instruction   |   8051 JC Instruction   |   8051 JB Instruction   |   8051 JNC Instruction   |   8051 JNB Instruction

List of topics: 8051

No comments:

Post a Comment