Activation Record: Short Notes (Stack Frames in Procedure Calls)

Activation Record: Short Notes (Stack Frames in Procedure Calls)

Verified Sources
Sep 12, 2026

An Activation Record (also called a Stack Frame or Procedure Frame is the per-call region of memory used to support parameter passing, local storage, saved state, and control-flow return. In typical implementations, an activation record is allocated on a Call Stack during the function prologue and deallocated during the epilogue.

Conceptually, an activation record stores:

  • where to return after the call finishes (Return Address),
  • how to reach the caller’s frame (Dynamic Link),
  • (for nested scopes) how to reach an appropriate statically enclosing frame (Static Link),
  • saved Callee-Saved Registers,
  • the procedure’s Parameters,
  • the Local Variables,
  • housekeeping such as stack pointer/frame pointer values.

A simplified relationship between nested calls can be visualized as:

Key idea: each procedure call has its own activation record, and nested calls form a stack discipline—new frames are pushed and removed in LIFO order.

Important: Activation record layout is largely a compiler/ABI decision. Different ABIs and calling conventions can vary the exact placement/order of fields, but the functional roles remain similar.

Activation Records / Stack Frames (concept overview)

What goes into an activation record? (short notes)

A standard activation record for a procedure call typically contains the following components:

ComponentPurposeCommon keyword(s)
Return addressResume execution at the correct instructionreturn address
Dynamic linkReference to caller’s activation record (previous frame)dynamic link / control link
Static link (nested functions)Reference to lexically enclosing scope’s framestatic link
ParametersValues passed by the callerarguments / formals
Local variablesStorage for local computationlocals
Saved registersPreserve registers that the called function overwritescallee-saved registers
Saved frame/stack pointersEnable stable addressing and unwindingframe pointer / stack pointer
Temporary spill spaceSpace for compiler-generated temps (register spills)temps

These roles align with the general descriptions of activation records and stack frames found in standard references. 3

Footnotes

  1. Call stack - Overview of call stacks and stack frames used for function calls.

  2. Activation record - Definition and typical contents of activation records.

  3. Stack frame - What stack frames contain and their relationship to activation records.

Lifecycle of an activation record

Caller prepares

Call issued

Evaluates arguments and transfers control to callee."

Frame created

Callee prologue

Allocates space on the call stack; saves required state; sets up access to locals/params."

Use frame contents

Execution

Reads parameters, writes locals/temporaries, may reference links for non-local data."

Frame removed

Callee epilogue

Restores saved state; deallocates frame; prepares to return."

Control resumes

Return to caller

Returns using the return address and restores the caller’s context."

When the language supports Lexical scoping and nested procedures, the callee may need access to variables from enclosing scopes.

  • Dynamic Link: enables walking the call chain according to runtime call history.
  • Static Link: enables locating the activation record of the lexically enclosing scope (by compile-time nesting structure), even if the current call stack differs from lexical nesting.

This distinction is a standard motivation for including both links in activation records for languages with nested functions.

Footnotes

  1. Activation record - Definition and typical contents of activation records.

How procedure call/return uses an activation record

  1. 1
    Step 1

    On entry, the callee reserves stack space for parameters access, locals, saved registers, and temps.

  2. 2
    Step 2

    The callee saves any registers that must be preserved and records information needed to restore execution.

  3. 3
    Step 3

    The callee sets up addressing (often via a frame pointer or fixed offsets from the stack pointer) so locals/params have stable locations.

  4. 4
    Step 4

    The procedure reads its parameters, updates local variables, and uses links (dynamic/static) when needed.

  5. 5
    Step 5

    The callee places the return value in the agreed location per the calling convention.

  6. 6
    Step 6

    The epilogue restores saved registers and stack/frame pointers.

  7. 7
    Step 7

    "Control jumps back using the stored return address so the caller can continue."

    This workflow corresponds to common definitions of activation records/stack frames and their role in calling conventions. 4

    Footnotes

    1. Call stack - Overview of call stacks and stack frames used for function calls.

    2. Activation record - Definition and typical contents of activation records.

    3. Calling convention - How ABIs specify parameter passing, return values, and register saving.

    4. Stack frame - What stack frames contain and their relationship to activation records.

Pro Tip

In exams, always describe what the activation record stores (return address, links, params, locals) and why (return control, variable access, nesting support). The exact byte layout is usually not required.

Warning

"Do not assume a single universal activation record layout. Calling conventions and ABIs differ: register saving strategy, presence of a frame pointer, and parameter passing (register vs stack) can vary. Base your notes on roles, not specific offsets."

Footnotes

  1. Calling convention - How ABIs specify parameter passing, return values, and register saving.

Activation record and calling conventions (what can vary)

Calling conventions specify rules for:

  • where arguments are placed (registers and/or stack),
  • where return values are placed,
  • which registers are caller-saved vs callee-saved,
  • stack alignment requirements,
  • how the return address is handled.

Those rules determine which fields must appear in the activation record and how prologue/epilogue code behaves.

Footnotes

  1. Calling convention - How ABIs specify parameter passing, return values, and register saving.

Minimal example layout (conceptual)

Below is a conceptual (not ABI-specific) layout of a typical activation record on a stack:

Again, exact ordering differs, but the components are the ones you should mention in “short notes.” 2

Footnotes

  1. Activation record - Definition and typical contents of activation records.

  2. Stack frame - What stack frames contain and their relationship to activation records.

Activation Record Short Notes Deck

1 / 5
Question · Term

Activation Record

Click to reveal
Answer · Definition

Per-call runtime memory region (stack frame) holding return control, links, parameters, locals, and saved state.

Footnotes

  1. Activation record - Definition and typical contents of activation records.

Knowledge Check

Question 1 of 4
Q1Single choice

Which item is most commonly used to resume execution after a procedure finishes?

Explore Related Topics

1

Various Addressing Modes of 8051 Microcontroller

The 8051 microcontroller provides multiple addressing modes that define how an instruction identifies the location or value of its operand.

  • Immediate (#data) – constant value encoded in the instruction, used for loading fixed numbers.
  • Register (Rn) – operand resides in CPU registers R0‑R7 (or A/B), giving the shortest and fastest code.
  • Direct (addr) – 8‑bit address is part of the opcode, accessing internal RAM or SFRs directly.
  • Register indirect (@R0, @R1, @DPTR) – a register holds the operand’s address, enabling pointer‑like traversal of memory.
  • Indexed (@A+DPTR or @A+PC) – adds the accumulator to DPTR or PC for table look‑ups in code memory; branch modes (relative, absolute, long) extend this concept for short, page‑limited, and full‑range jumps.
2

Write Short Notes on UML Diagrams

3

Understanding Activation Records and Variable Resolution in Compiler Design

Activation records (stack frames) are the runtime structures that store a function’s context, support calls—including recursion—and enable variable access through fixed offsets and scope links.

  • Local variables are accessed in O(1) time by adding a compile‑time constant offset to the frame pointer (FP).
  • Non‑local variables in lexically scoped languages use a static (access) link to the activation record of the enclosing block, while the dynamic (control) link points to the caller’s record.
  • The function call lifecycle involves argument evaluation, saving return address, establishing FP, allocating locals, executing, and tearing down the frame.
  • Optimizations such as display registers provide constant‑time access to any outer scope, avoiding long static‑link traversals.