Wednesday, March 23, 2016

8051 Unconditional and Conditional Jump

There are 2 types of Jump in 8051: Unconditional and Conditional

Unconditional Jump:
The unconditional jump is a jump in which control is transferred unconditionally to the target location.

MnemonicDescription
AJMP addr11Absolute Jump transfers program execution to the indicated address, which is formed at run-time
LJMP addr16Long Jump causes an unconditional branch to the indicated address
SJMP rel (addr8)Short Jump unconditionally to the address (relative) indicated
JMP @A+DPTRJump indirect relative to the DPTR

Conditional Jump:
The conditional jump is a jump in which control is transferred to the target location only if a specified condition is met. All conditional jumps are short jump.

MnemonicDescription
JZ relative addressJump if Accumulator is Zero
JNZ relative addressJump if Accumulator is Not Zero
CJNE A, direct, relative addressCompare direct byte to Acc and Jump if Not Equal
CJNE A, #data, relative addressCompare immediate to Acc and Jump if Not Equal
CJNE Rn, #data, relative addressCompare immediate to register and Jump if Not Equal
CJNE @Ri,#data, relative addressCompare immediate to indirect and Jump if Not Equal
DJNZ Rn, relative addressDecrement register and Jump if Not Zero
DJNZ direct, relative addressDecrement direct byte and Jump if Not Zero
JC relative addressJump if Carry is set
JNC relative addressJump if Carry not set
JB bit address, relative addressJump if Bit set
JNB bit address, relative addressJump if Bit Not set
JBC bit address, relative addressJump if Bit is set and Clear bit



Related topics:
8051 Long Jump   |   8051 Absolute Jump   |   8051 Short Jump   |   8051 Indirect Jump   |   8051 Jump if Accumulator Zero   |   8051 Jump if Accumulator Not Zero   |   8051 Compare and Jump if Not Equal   |   8051 Decrement and Jump if Not Zero   |   8051 Jump if Carry is Set   |   8051 Jump if Carry is Not Set   |   8051 Jump if Bit Set   |   8051 Jump if Bit Not Set   |   8051 Jump if Bit is Set and Clear Bit

List of topics: 8051

No comments:

Post a Comment