Nick Ing-Simmons wrote:
> >That comment reminds me of how the register file is implemented in
> >a sun sparc. They have a large register file, but only some are accessable
> >at any given time, say 16.
>
> 32 IIRC but principle is correct.
8 global registers, 8 out registers, 8 local registers and 8 in registers.
Some are set aside for special purposes, e.g. %r14 is stack pointer, %r15 is
called subroutine return addr etc. Effectively you have 6 'in' and 6 'out'
registers Extra arguments above 6 are passed in the caller's stack frame.
> 1. When you call deep enough to fall off the end of the large register
> file an expensive "system call" is needed to save some registers
> at the other end to memory and "wrap", and then again when you
> come "back" to the now-in-memory registers.
Not a system call but a trap - they aren't the same thing (pedant mode off
;-). The register spill trap handler copies the relevant registers onto the
stack - each stack frame has space allocated for this.
Alan Burlison