Jump Instructions in 8086 Microprocessor || Unconditional Jump || Conditional Jump

Опубликовано: 06 Октябрь 2024
на канале: Learning Hub
5,220
54

Jump Instructions are used for changing the flow of execution of instructions in the processor. If we want jump to any instruction in between the code, then this can be achieved by these instructions. There are two types of Jump instructions:

Unconditional Jump Instructions
Conditional Jump Instructions
1) Unconditional Jump Instructions
These instructions are used to jump on a particular location unconditionally, i.e. there is no need to satisfy any condition for the jump to take place.

2) Conditional Jumps
In these types of instructions, the processor must check for the particular condition. If it is true, then only the jump takes place else the normal flow in the execution of the statements is maintained.

The ALU operations set flags in the status word (Flag register). The conditional jump statements tests the flag and jump is the flag is set.

There are following types of conditional jump instructions:

i) JC : Stands for 'Jump if Carry'

It checks whether the carry flag is set or not. If yes, then jump takes place, that is: If CF = 1, then jump.

ii) JNC : Stands for 'Jump if Not Carry'

It checks whether the carry flag is reset or not. If yes, then jump takes place, that is: If CF = 0, then jump.

iii) JE / JZ : Stands for 'Jump if Equal' or 'Jump if Zero'

It checks whether the zero flag is set or not. If yes, then jump takes place, that is: If ZF = 1, then jump.

iv) JNE / JNZ : Stands for 'Jump if Not Equal' or 'Jump if Not Zero'

It checks whether the zero flag is reset or not. If yes, then jump takes place, that is: If ZF = 0, then jump.

v) JP / JPE : Stands for 'Jump if Parity' or 'Jump if Even Parity'

It checks whether the Parity flag is set or not. If yes, then jump takes place, that is: If PF = 1, then jump.

vi) JNP / JPO : Stands for 'Jump if Not Parity' or 'Jump if Odd Parity'

It checks whether the Parity flag is reset or not. If yes, then jump takes place, that is: If PF = 0, then jump.