[Oberon] Oberon-07 - SYSTEM.MSET

Chris Burrows chris at cfbsoftware.com
Fri Jun 26 09:17:10 CEST 2020

> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of John
> R. Strohm
> Sent: Friday, 26 June 2020 2:51 PM
> To: ETH Oberon and related systems
> Subject: Re: [Oberon] Oberon-07 - SYSTEM.MSET
> > --- joerg.straube at iaeth.ch wrote:
> > In my point of view it s not worth the effort as eg
> >
> > SYSTEM.PUT(Display.Base, 0BABEFACEH);
> >   Display.Base, Display.Base+4, 24575
> > );
> >
> > fills the b/w screen with an arbitrary word.
> Arguably, this should be undefined behavior.  SYSTEM.COPY() should
> ideally be defined to be unpredictable if the blocks overlap, to allow an
> implementation to run the loop "backwards", if that would yield better
> performance on that particular system.
> I do not recall offhand whether SYSTEM.PUT() is expected to expand
> inline, or do a subroutine call.  If the latter, it would make sense to
> provide a SYSTEM.MEMSET().

SYSTEM.PUT in both the RISC5 and Astrobe ARM Cortex-M compilers expands inline.

Using the auto-increment extension to SYSTEM.PUT in the Astrobe for ARM Cortex-M compilers, the main processing loop in the following statement only uses three instructions as opposed to four when SYSTEM.COPY is used:

  REPEAT SYSTEM.PUT(addr, data, 4) UNTIL addr = limit; 

Chris Burrows
CFB Software

More information about the Oberon mailing list