Microprocessor_pdf
Microprocessor_pdf
Introduction -
Branching instructions are essential for altering the
flow of execution in a program. They allow the CPU
to make decisions based on certain conditions,
enabling control structures such as loops and
conditional statements.
1. Unconditional branching
2. Conditional branching
Unconditional Branching:
• Unconditional branching instructions always change the flow of execution to a specified
address, regardless of any conditions or flag statuses. eg.- JMP (Jump), CALL (Call
Subroutine), RET (Return from Subroutine).
Conditional branching:
• Conditional branching instructions alter the flow of execution based on the status of the
processor flags (Zero, Carry, Sign, etc.).
• eg. - JZ(Jump if Zero), JNZ(Jump if Not Zero), JC(Jump if Carry), JNC(Jump if No Carry),
JP(Jump if Positive), JM(Jump if Negative), JPE(Jump if Parity Even), JPO(Jump if Parity
Odd)
Ponty | 2022BCSE011
If the instruction at memory location 2050H is JMP 2000H, the next instruction that the
microprocessor will execute is the one at memory location 2000H, skipping all instructions in
between.
Example: JC 3000H ; Jump to memory location 3000H if the Carry flag is set
If an addition like MOV A, 09H and ADD A, 08H results in a carry (A becomes 17H, setting the
Carry flag), the JC instruction will jump to memory location 3000H.
Example: JNC 3500H ; Jump to memory location 3500H if no carry is present For instance,
after an operation like SUB or ADD, if there is no carry, the microprocessor will
jump to memory location 3500H.
Example:
JC and JNC for controlling how overflow or borrowing from subtraction is handled.
JZ for jumping to error-handling routines when zero results from a comparison.
JMP for directing execution to di erent parts of a program unconditionally.
Example :
Ponty | 2022BCSE011
References
1. Geeks for Geeks. (n.d.). 8085 Microprocessor
Branching Instructions. Retrieved from Geeks for
Geeks
2. ChatGPT by OpenAI. (2024). Explanation of
Branching Instructions in 8085 Microprocessor.
3. SlideShare. (n.d.). 8085 Branching Instructions.
Retrieved from SlideShare