[Oberon] INC(i) vs i := i + 1

Chris Burrows chris at cfbsoftware.com
Wed May 5 12:04:13 CEST 2021


> 
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of Joerg
> Sent: Wednesday, 5 May 2021 6:00 PM
> To: ETH Oberon and related systems
> Subject: Re: [Oberon] INC(i) vs i := i + 1
> 
> Just as an example, find below the output of the RISC5 compiler:
> 
> The statements  i := i+1;  and  INC(i);  generate exactly the same output,

That is true if i is a local or global variable or a value parameter. However, if i is a VAR parameter, the INC version generates one less instruction.

Regards,
Chris Burrows
CFB Software
https://www.astrobe.com




More information about the Oberon mailing list