Branching instructions in 8086 microprocessor

11,953 views 15 slides Jan 27, 2018
Slide 1
Slide 1 of 15
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15

About This Presentation

It contains all the type of branching instructions used in 8086 microprocessor. It is also useful for making notes.


Slide Content

Branching Instructions in 8086 1 Presented by: Rabin BK BSc.CSIT 2 nd Semester

CONTENTS About Branch I nstructions Unconditional branch instructions 1.CALL 2.RET 3.INT 4.INTO 5.IRET 6.JMP Conditional branch instructions 1.JZ/JE label 2.JNZ/JNE label 3. JS label 4. JNS label 5. JO label 6. JNO label 7.JNP label 8. JP label 9. JC label 10. JNC label 11. JCXZ label 12. LOOPZ/LOOPE label 13. LOOPNZ/LOOPENE label References 2

3 8085 Microprocessor

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

Queries 15