[Oberon] Standalone BootLoader format
Andreas Pirklbauer
andreas_pirklbauer at yahoo.com
Wed May 13 17:38:56 CEST 2020
> Interesting, no SB then.
Correct. No more SB in PO 2013 now. As I said earlier, the book is out of date in this respect.
> Does this imply SB was to 0 most of the time, so R13 is now free for general purpose?
Yes, R13 is now free for general purpose… Except that the current PO 2013 implementation
does not make use of it. You can see this by looking at module ORG, where procedure incR
still only uses registers R0..R11 (Note: MT=12)
PROCEDURE incR;
BEGIN IF RH < MT-1 THEN INC(RH) ELSE ORS.Mark("register stack overflow") END
END incR;
So, R13 is wasteland in PO 2013. Unfortunately (in Extended Oberon I have fixed this).
> Does this lead to a shorter more compact code?
No, it doesn’t. But it makes the compiler simpler. See the release note on news.txt
20180720 - Update compiler: ORP.Mod.txt and ORG.Mod.txt
Cache for base adr of global variables "curSB" has been removed from ORG.Mod.
Removal of this optimization makes compiler simpler.
In fact.,not only was the cache (curSB) removed, but also the use of SB = R13 (don’t
quote my on this, but I believe that those two changes were made at the same time).
> I wish I could say I am now less confused :-)
Tomas - I believe you somehow have a knot in your brain. This is really not all that
hard to understand. I just wouldn’t blindly trust what is written in the book.
One good way to further your understanding of this is to simply trace code
generation, linking, booting through the corresponding CODE in the compiler,
linker, loader. You just have to fiddle around a bit. After a while you will get
completely detached from the book. The code is the ultimate truth. Even with
an (otherwise really outstanding) book like Project Oberon 2013 Edition.
If this is comforting to you: When the original version of Project Oberon came
out around 1992, I immediately found a dozen or so places, where it was
already out of date relative to the then-current implementation of Ceres-Oberon.
Only minor things though. A book is just not as dynamic as code.
More information about the Oberon
mailing list