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

Peter Matthias PeterMatthias at web.de
Wed Dec 19 18:48:08 CET 2018



Am 19.12.18 um 18:08 schrieb Paul Reed:
> Hi Peter,
> 
>> There comes the question: why is the register variable loaded before the
>> parameters are evaluated? To save a register? This should not matter on
>> RISC5. Looks to me it would be much nicer code without.
> 
> Not sure what you mean.  The value of the procedure (proper procedure or
> function) variable will be in a register before the parameter evaluation
> if, for example, it comes from looking up in an array or dereferencing a
> pointer.

Currently, the procedure address is put in R0, R0 is stored on stack, 
the parameters are passed beginning from R0 and procedure address is 
loaded from stack to next free register. I suppose it would be possible 
as well to first pass the parameters beginning with R0 and then directly 
put procedure address in next free register.

Peter


More information about the Oberon mailing list