Operand Model — Named Slots
Overview
VERA uses named slots instead of registers. A slot is a named storage location scoped to a function. The compiler decides whether each slot lives in a hardware register, on the stack, or is spilled to memory.
Slot Rules
- Slots are declared implicitly on first assignment (when they appear as a destination).
- Slot names are alphanumeric identifiers with underscores:
[a-zA-Z_][a-zA-Z0-9_]* - Slots are scoped to their enclosing function — no global slots (use
globalfor that). - Slots have a fixed type determined by the first instruction that writes to them.
- A slot's type must be consistent across all instructions that reference it. It is an error to use
countasi64in one instruction andf64in another. - Slots can be reassigned (they are not single-assignment).
Why Not Registers
Explicit registers (r0, r1, rax, x0) are architectural concerns. They make the representation non-portable and force the author to do register allocation — a job the compiler does better. Named slots let the agent focus on logic while the compiler handles resource mapping.
Why Not Variables
Slots are not variables in the programming-language sense. There is no scope nesting, no shadowing, no lifetime management at the language level. A slot is simply a name for a value that the compiler maps to physical storage. This keeps VERA at the assembly level.