Call Instruction

From SEGGER Knowledge Base
Revision as of 01:55, 8 September 2025 by Rolf (talk | contribs)
Jump to navigation Jump to search

In computer and embedded systems, a call instruction changes the PC to the address of the subroutine to call and preserves the return address, thereby giving the subroutine called a chance to return and resume operation with the instruction following the call.

Overview

All CPUs have a PC, and all CPUs have the ability to jump, meaning to change the PC and continue program execution at a different point, instead of the following instruction. Jumps can be conditional or unconditional, and their encoding can be absolute, relative or indirect (taken from another register). A call is very similar to a jump (in some architectures also called branch), the difference is that the return address is preserved so that the called routine (callee) can return, meaning continue executing the instructions immediately following the call instruction. branches to a subroutine or procedure before ultimately returning to the point from which it was called. This is in contrast to a jump instruction, whereby control does not automatically return to the point from which it was called.