PhysicsTeacher.in

High School Physics + more

Differences between JUMP and CALL instructions in 8085

JUMP and CALL both are branching instructions that can transfer control of execution from one memory location to another. In this post, we will discuss the differences between JUMP and CALL instructions in 8085.

JUMP instruction updates the program counter (PC) value and makes it point to another location inside the main program while a CALL instruction is used in the main program to call a subroutine and the program control is transferred to a memory location (where the subroutine program is stored) which is not a part of the main program.

Now we will discuss JUMP and CALL instructions in detail before listing their differences.

CALL Instruction Execution

Execution of CALL instruction happens in the following two steps:

  • Push the address of the instruction immediately following the CALL onto the stack
  • Load the program counter with the 16-bit address supplied with the CALL instruction.

  • A CALL instruction necessarily requires the initialization of a Stack Pointer (SP). When the CALL instruction is used to call a subroutine and the execution of this subroutine is completed, then the program control is transferred back to the main program by using the RET instruction.
  • When the RET instruction is executed at the end of the subroutine, the memory address stored on the stack is retrieved and it will be loaded into the program counter(PC).

Example of CALL and RET instructions

CALL address

Stack <- [PC]
and [PC] <- Address

RET

[PC] <- Stack

Execution of CALL instruction requires 5 machine cycles and 18 T-states.

FAQ Related to CALL

Q] What do you mean by the Initialization of a Stack Pointer (SP)?

Answer] Initialization of a Stack Pointer (SP): The beginning of the stack is defined in the program by using the instruction LXI SP, which loads a 16-bit memory address in the stack pointer register of the microprocessor.

JUMP Instruction Execution

  • Load the program counter with the 16-bit address supplied with the JUMP instruction.
  • Initialization of a Stack Pointer (SP) is not mandatory.

Example of JUMP instruction

JUMP address

[PC] <- Address

One important point about the JUMP instruction is that it does not require any return instruction after the execution of the JUMP instruction.

The JUMP instruction requires only 3 machine cycles, which is less than that for the CALL instruction.

Differences between JUMP Instruction and CALL Instruction

S.No.JUMP InstructionCALL instruction
1.By using JUMP, the program control transfers to a location that is also a part of the main programBy using CALL instruction, the program control transfers to a subroutine location that is not part of the main program.
2.Return instruction is not required after JUMP instruction.After CALL, it enters into a subroutine and to come back from the subroutine we need the return instruction at the end of the subroutine.
3.Initialization of the Stack Pointer (SP) is not mandatory to perform the JUMP instruction.We have to initialize the Stack Pointer (SP) before using CALL instruction.
4.The program counter value is not Pushed into the StackThe value of the program counter is pushed into the stack before going to the pointed location.
5.The value of the stack pointer remains unchangedThe value of the Stack Pointer is decremented by 2.
6.3 Machine cycles are needed for the execution of JUMP5 Machine cycles are needed for CALL instruction.
7.10 T-States are required to perform JUMP instruction18 T-States are required to perform CALL instruction.

Author of this post

This post is co-authored by Professor Saraswati Saha, who is an assistant professor at RCCIIT, a renowned degree engineering college in India. Professor Saha teaches subjects related to digital electronics & microprocessors.

See also  Arithmetic Instructions in 8085 - PhysicsTeacher.in
Scroll to top
error: physicsTeacher.in