UP | HOME

How compilers handle procedure calls

This note describes how the high-level abstraction of the procedure call is implemented in Assembly, as handled by the compiler.

When a procedure is called, we jump to the section of the code which contains the procedure body.

We use a stack to hold activation records which hold:

Each time a procedure is called, a new activation record is pushed onto the stack.

The stack exists in memory. We reserve some registers to make procedure calls and using the stack easier:

The caller:

The callee:

1 Sources