[Oberon] Question on ORG.SaveRegs / ORG.RestoreRegs in the FPGA Oberon compiler
Paul Reed
paulreed at paddedcell.com
Tue Dec 18 22:41:47 CET 2018
> But still, shouldn’t this register be somehow accounted for ?
> ... by
> ELSE Put2(Ldr, RH, SP, 0); Put1(Add, SP, SP, 4); DEC(r); DEC(frame, 4)
Right. If the procedure variable was not actually loaded before the
parameters were evaluated (ie the procedure was not the result of an
expression), no registers needed to be saved, so the save is explicitly
avoided.
It's only in the case where it was already loaded into a register
(detected by RH > 0 before the save), where it was therefore saved (first,
fortunately), and consequently needs to be explicitly restored.
It's RestoreRegs(1), in effect, but only in that case. Anyway, I'm
labouring it, you've answered your own question! :)
Cheers
Paul
More information about the Oberon
mailing list