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

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Tue Dec 18 22:21:11 CET 2018


   > ...but ALSO for *regular* procedures, i.e. in ORP.StatSequence…
   >
   > But in this case, surely RH is 0 so no registers are saved?  Maybe the
   > apparent asymmetry comes from having to handle procedure variables too.

That’s indeed the reason: when one calls a procedure variable, e.g. V.handle in
Viewers, then dereferencing V to get to V.handle in ORP.selector/ ORG.DeRef
will use up an additional register, so RH = 1 in PrepCall.

But still, shouldn’t this register be somehow accounted for ?
Perhaps with the second of the following lines in ORG.Call:

      IF x.mode <= ORB.Par THEN load(x); DEC(RH)
      ELSE Put2(Ldr, RH, SP, 0); Put1(Add, SP, SP, 4); DEC(r); DEC(frame, 4)     <---
      END ;

I just haven’t investigated yet.. 

-ap





More information about the Oberon mailing list