T ransferring the flow of execution of the program to a new address specified in the instruction directly or indirectly. When the instruction is executed, the Code S egment (CS) and Program Counter/Instruction Pointer (IP) registers get loaded with new values of CS and IP corresponding to the location to be transferred . Two types of branching instructions: Unconditional Conditional 4 BRANCHING INSTRUCTION
T he execution control is transferred to the specified location independent of any status or condition . The CS and IP are unconditionally modified to the new value of CS and IP. 5 Unconditional Branching
It is used to call a Subroutine (Procedure) from a main program . On execution, it stores the incremented IP & CS onto the stack and loads the CS & IP registers with segment and offset addresses of the procedure to be called . Written at the end of the procedure When it is executed, the previously stored content of IP and CS along with Flags are retrieved into the CS, IP and Flag registers from the stack and execution of the main program continues further. 6 CALL RET
It is used to interrupt the program during execution and specified calling service. There are 256 interrupts defined corresponding to the types from 00H to FFH. Used to interrupt the program during execution if (Overflow Flag) OF = 1 7 INT INTO: Interrupt on Overflow
Used to return from interrupt service to the main program. It unconditionally transfers the control of execution to the specified address using an 8-bit or 16-bit displacement. No Flags are affected by this instruction. 8 IRET JMP
E xecution control is transferred to the address specified relatively in the instruction, provided the condition in the Opcode is satisfied . Otherwise execution continues sequentially. 9 Conditional Branching
Used to jump if equal/zero flag ZF = 1 Used to jump if not equal/zero flag ZF=0 Transfer execution control/jump to address ‘Label’, if (Sign Flag ) SF =1 . 10 JZ/JE Label JNZ/JNE Label JS Label
Transfer execution control/jump to address ‘Label’, if not (Sign Flag) SF=0 . Transfer execution control/jump to address ‘Label’, if OF=1. Used to jump if no overflow flag OF = 0. 11 JNS Label JO Label JNO Label
Transfer execution control to address ‘Label’, if PF (Parity Flag)= 0. Used to jump if parity/parity even PF = 1 . Transfer execution control to address ‘Label’, if CF(Carry Flag)= 1 . Transfer execution control to address ‘Label’, if CF=0. 12 JNP Label JP Label JC Label JNC Label
Transfer execution control to address ‘Label’, if CX=0 Used to loop a group of instructions till it satisfies ZF = 1 & CX = Loop through a sequence of instructions from label while ZF=1 and CX=0 . 13 JCXZ Label LOOPZ/LOOPE Label LOOPNZ / LOOPENE Label
R eferences Web reference: https://www.allsyllabus.com/aj/note/ECE/8086%20Microprocessor%20&%20Peripherals/unit%202/Branch%20Instructions%20.php#. WTz8ANWkrIU http:// www.electronics.dit.ie/staff/tscarff/8086_instruction_set/8086_instruction_set.html#LOOP http:// courses.ee.sun.ac.za/OLD/2003/Rekenaarstelsels245/8086_Instruksies/asm_tutorial_07.html https:// eclass.upatras.gr/modules/document/file.php/EE649/8086%20Registers.htm http:// 8086pro.blogspot.nl/2010/08/jump-branch-instructions.html https:// www.tutorialspoint.com/microprocessor/microprocessor_8086_instruction_sets.htm 14