--- chris@cfbsoftware.com wrote:
-----Original Message----- From: Tomas Kral [mailto:thomas.kral@email.cz] Sent: Friday, 26 June 2020 4:51 PM To: oberon@lists.inf.ethz.ch Cc: chris@cfbsoftware.com Subject: Re: [Oberon] Oberon-07 - SYSTEM.MSET
Using the auto-increment extension to SYSTEM.PUT
Interesting, PUT(VAR addr...), addr passed by reference?
Yes - there are two different signatures:
PROCEDURE PUT*(address: INTEGER; x: <any basic type>);
PROCEDURE PUT*(VAR address: INTEGER; x: <any basic type>; inc: INTEGER);
The original code fragment was (approximately) REPEAT SYSTEM.PUT(addr, value, incr) UNTIL addr > limit; This is logically equivalent to REPEAT BEGIN SYSTEM.PUT(addr, value); addr := addr + incr; END UNTIL addr > limit; I am admittedly not up on typical Oberon compiler optimization, but I would generally expect a compiler smart enough to inline the SYSTEM.PUT() call, in either case, to be able to optimize in the autoincrement as well. And, if I was doing the above a lot, I would want a SYSTEM.MEMSET() that expanded inline. --John R. Strohm
participants (1)
-
John R. Strohm