Piers Cawley wrote:

Leopold Toetsch <[EMAIL PROTECTED]> writes:

Out of interest, why do we have distinct register and user stacks?

User stack entries are typed and you save and restore one item per operation. The register backing stores first took 32 registers of one kind (now 16 or 32). To get values around a pop on register stack, you need both:


   save P5
   popp
   restore P5   # all but P5 restored


But I have the feeling I'm thinking IMCC is rather more sophisticated
than it is in real life. From the point of view of a programmer, the
important thing is that invoking a continuation should return the upper
and control registers (but not the argument registers) to the state
they were in when the continuation was made. How the continuation is
subsequently stored/passed is completely irrelevant to this.

That's clear. The problem is the register stack restore sequence at the continuation's destination label. This sequence must match the store operations at the point, where the continuation is constructed.



leo





Reply via email to