On Thu, 8 Jan 2004, Luke Palmer wrote: > @pcc_sub_call_4: > set P0, P17 > set P1, P16 > set I0, 0 > set I1, 0 > set I2, 0 > set I3, -2 > updatecc > savetop > invoke > done: > restoretop > set P16, P5 > > When the continuation is invoked, that savetop it just did is completely > nullified, and you're back to the state before you created the > continuation. So, in order to get this to work properly, your first > four lines must be: > > .sub __main__ > newsub $P0, .Closure, _func > savetop > newsub $P0, .Continuation, done > > So the restoretop after the invoke has something to pop (and so your > register state isn't screwed up when you get back).
Thanks Luke. I changed my compiler to call savetop before every function call, and that passes my tests but I'm having trouble visualizing why. Would I ever NOT want to call savetop before creating a continuation? Sincerely, Michal J Wallace Sabren Enterprises, Inc. ------------------------------------- contact: [EMAIL PROTECTED] hosting: http://www.cornerhost.com/ my site: http://www.withoutane.com/ --------------------------------------