8051 Microcontroller Instruction Set
All instructions of the mcs-51 microcontroller are shown on 79 pages.
For example the instruction JB bit,rel
Jump if bit is set
If the indicated bit is 1, jump to the address indicated; otherwise proceed with the next step. 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. The bit tested is not modified. No flags are affected.
The data present at input port 1 is 11001010B. The accumulator holds 56 (01010110B). The instruction sequence
will cause program execution to branch to the instruction at label LABEL2.
(PC) = (PC) + 3
if (bit) = 1 then
(PC) = (PC) + rel
0 0 1 0 0 0 0 0 + bit address + rel. address