When a subroutine is called, the address of the instruction following the CALL…

2017

When a subroutine is called, the address of the instruction following the CALL instruction is stored in the ______.

  1. A.

    program counter

  2. B.

    stack

  3. C.

    stack pointer

  4. D.

    accumulator

Attempted by 121 students.

Show answer & explanation

Correct answer: B

When a subroutine is called, the CPU must remember where to return after the subroutine finishes.

Therefore, the address of the next instruction after CALL is pushed onto the stack.

After the subroutine completes, this return address is popped from the stack.

Explore the full course: Niacl Ao It Specialist