Branch Type of Instructions 8085 8085 Microprocessor by Ravinder Nath Rajotiya - December 14, 2020May 10, 20210 Branch Type Instructions: Branch Type Instructions These type of instructions can be unconditional or conditional branch instruction. and are given below: Unconditional Branch JMP 16-bit Address (Label) CALL 16-bit Address (Label) RET ; Return from Subroutine RST n ; restart is a one byte call instruction, and jumps to the instruction at restart addre. Conditional Branch JZ 16-bit Address (Label) JNZ 16-bit Address (Label) JC 16-bit Address (Label) JNC 16-bit Address (Label) JP 16-bit Address (Label); if result is positive JM 16-bit Address (Label); if result is Minus JPE 16-bit Address (Label); If even parity JPO 16-bit Address (Label); if odd parity Unconditional Call CALL 16-bit Address RET 16-bit address Conditional Call Instructions Opcode Description
Loop Instructions 8086 Microprocessor 8086 Microprocessor by Ravinder Nath Rajotiya - December 14, 2020May 10, 20210 Loop using DEC and JMP Instructions We are familiar with the conditional branch instructions which as shown below could be used for repetitive tasks. Looping using these technique involve more than one instruction as shown in following format MOV CX, N Begin : do some operation operations DEC CX JNZ Begin Loop Instructions in 8086: loop instructions are used to simplify the decrementing, testing and branching portion of the loop. In the above case this portion required two instructions, but in more complicated situation may require more than two instructions. The loop instruction for 8086 all have the form: OPCODE D8 where D8 is byte displacement from current IP. The loop instruction is simplified to: With loop instruction the format for branch become: MOV CX, N Begin: -- -- LOOP Begin The Loop
Branch Type Instructions 8086 8086 Microprocessor by Ravinder Nath Rajotiya - December 14, 2020May 10, 20210 Branch Instruction: The branch instruction is used to transfer the control of the program to a new address. This branch can be Conditional or Unconditional. Once the branch is taken the execution of instructions will take place from this new address called branch address. Usually the Conditional branch is taken after the ADD, SUB, INC, DEC and the instructions used to implement the LOOP. When these types of instructions are executed, the CS and IP registers get loaded with new values of CS and IP corresponding to the location where a branch is required. The branch instruction can be one of the following types. Unconditional Jump instructions: JMP, CALL, RET, INT N, INTO, IRET, LOOP, Conditional Jump instructions: JA/JNBE, JAE/JNB, JB/JNAE, JC, JNC, JE /JZ, JNE