Describe various branch instructions in 8086 microprocessor.
Various branch instructions are as follows :
(i) Jump Instructions : This group of instructions will always cause the 8086 to fetch its next instruction from the location specified or indicated by instruction rather that from the next location after the JMP instruction. The JMP instructions are basically classified as unconditional jump and conditional jump instructions. A conditional jump instruction allows the programmer to make decisions based upon numerical tests. The results of numerical tests are held in the flag bits, which are then tested by conditional jump instructions.
The jump instructions are further classified as short, near and far jump instructions.
Short
EB
|
Disp
|
Near
Opcode
E9
|
Disp Low
|
Disp High
|
Far
Opcode
EA
|
IP Low
|
IP High
|
CS Low
|
CS High
|
(ii) Call Instructions : The CALL instruction differs from the JMP instruction because a call instruction saves the return address on the stack. On execution of the RET instruction, the program returns to the place where the CALL was enabled. It is 2 types, namely, near CALL and Far Call.
Near Call : It is 3 byte instruction with 1st byte containing the opcode and 2nd and 3rd byte containing the 16 bit displacement. Example OFFFH, this identical to the form of near jump.
Far Call : The far call is like far jump. It is 5 byte instruction.
(iii) Interrupt Instruction :
- Int Instruction (INT type) : This instruction causes the 8086 to call a far procedure. The term type in the instruction refers to a number between 0-255 which identifies the interrupt. The address of the procedure is taken from the memory whose address is four times the type number.
- INTO Instruction : If the overflow flag is set, this instruction will cause the 8086 to do an indirect far call to a procedure you write to handle overflow condition. To do call the 8086 will read a new value or IP from address 000 10H and a new value of CS from address 000 12H.
- IRET Instruction : The IRET instruction is used at the end of the interrupt services routine to return execution to the interrupt program. The 8086 copies return address from stack into IP and CS registers and the stored value of flags back to the flag register.