"jmcgill" <> wrote in message
news:7ws8g.4754$_c1.224@fed1read05...
> Oliver Wong wrote:
>
> > It's been a long time since I've done development in assembly,
>
> It's been less than a week for me 
>
> > rotating window circular-buffer thing to
>> emulate an infinite number of registers, given sufficient amount of RAM.
>
> If you have to load a value from RAM, you not only are defeating the
> purpose of a register access, but you are also replacing register access,
> the fastest operation in the datapath, with memory access, the slowest.
Let's say the registers are numbered 0 to 119. You start up with the
window pointing at registers 0 to 19. You do some fiddling there, and decide
you want more a new set of registers (e.g. because you're about to jump to a
sub procedure), so the window rolls over to point to 20 to 39. When you
start getting dangerously near to 119, a background process kicks in and
saves the values from 0 to 19 to RAM, so by the time you tell the CPU you
want the window to roll over and give you the logical registers 120 to 139,
you'll actually be using the physical registers 0 to 19, and no data lost
will occur. Also, since the background process intelligently waits until the
memory channels are idle before doing its background save, no delay is
noticed.
Something like that, anyway. It's been a couple of years since I've
worked on this architecture.
- Oliver