Method and apparatus for managing access to registers that are outside a
current register stack frame are disclosed. An instruction execution unit
in a processor receives an instruction to be executed. A processor
includes a register stack, the register stack including a plurality of
register stack frames. Each of the register stack frames includes zero or
more registers. One of the plurality of register stack frames is a
current register stack frame. When execution of the instruction requires
writing to a register referenced by the instruction, the instruction
execution unit determines whether the register referenced by the
instruction is within the current register stack frame. If the
instruction execution unit determines that the register is not within the
current register stack frame, the instruction execution unit does not
execute the instruction and may, for example, generate a fault. The
instruction execution unit executes the instruction is the instruction
execution unit determines that the register is within the current
register stack frame. When execution of the instruction requires reading
from a register referenced by the instruction, the instruction execution
unit executes the instruction whether or not the register referenced by
the instruction is within the current register stack frame.