[Oberon] Question on ORG.SaveRegs / ORG.RestoreRegs in the FPGA Oberon compiler

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Thu Dec 20 09:12:51 CET 2018

   > Answer to my question is that e.g. in Display.Handle at F.handle(F, M),
   > F is dereferenced before you know the amount of parameters, and for
   > this, it is easiest to intertemporally store the value on the stack.

This is why the question to this forum was asked initially and which was a little irritating at
first. It's the only reason why the SaveRegs is *also* called for *regular* procedures, not just
for *function* procedures -- to save the (one) register used to hold the value of the procedure
if it happens to come from looking it up in an array or from dereferencing a pointer to get to it,
onto the stack (in PrepCall),  and to restore it again from the (top of the) stack (in Call).

It’s SaveRegs(1) in PrepCall and RestoreRegs(1) in Call, in effect.

More information about the Oberon mailing list