LOGBOOK

HELP

Quiz Entry - updated: 2026.11.27

The ESP32's cores have 64 physical address registers but only 16 names, a0 to a15. How does a register window connect the two, and what problem does it solve?

At any moment a0–a15 name a block of 16 out of the 64 physical registers. A function call slides that block forward, so the callee gets fresh registers and the caller's values stay where they are, without being saved to memory.

The 64 physical registers drawn as a ring of 16 groups of four; the windows of f, g and h each cover 16 registers and start 8 further on

* Three nested call8 windows on the 64-register ring. *

On most processors, a function that wants to use registers its caller also uses must first store the caller's values on the stack and reload them before returning. Those memory accesses happen on every call, and small functions are called constantly.

The register window avoids most of that work. A special register, WindowBase, says where in the physical register file a0 currently starts. A call moves WindowBase forward by 4, 8 or 12 registers, so the callee's a0 is a physical register further along than the caller's a0:

  • The registers behind the new window still hold the caller's values. The callee can't even name them, so it can't overwrite them.
  • The registers where old and new window overlap are shared, and that overlap is how arguments and results are passed.
  • On return, WindowBase moves back and the caller sees its registers exactly as it left them.

The cost is that 64 registers run out after a few nested calls. The hardware then raises a window overflow exception and a short handler spills the oldest frame's registers to the stack (see the card on when the stack is used).

The ESP32 uses this windowed ABI. The Xtensa architecture also has a plain CALL0 ABI with a fixed set of registers and no window, which some other Xtensa chips use.

Tip: Think of the 64 registers as a long shelf and a0–a15 as a 16-slot frame you slide along it. A call slides the frame; it doesn't empty the shelf.

Go deeper:

From Quiz: SIOT / Xtensa LX6 Registers, Calls and Branches in Assembly | Updated: Nov 27, 2026