Register R13

General discussions about using the Astrobe IDE to program the FPGA RISC5 cpu used in Project Oberon 2013
Post Reply
gray
Posts: 109
Joined: Tue Feb 12, 2019 2:59 am
Location: Mauritius

Register R13

Post by gray » Fri Feb 04, 2022 9:13 am

ORG.incR allocates registers up to R11. R12 is MT, R14 is SP, and R15 is LNK. What about R13, may I use it, or does it have a special purpose as well?

cfbsoftware
Site Admin
Posts: 493
Joined: Fri Dec 31, 2010 12:30 pm
Contact:

Re: Register R13

Post by cfbsoftware » Fri Feb 04, 2022 10:34 am

Refer to Section 8.1 Layout and run-time organization of the Project Oberon (2013) Documentation:

Code: Select all

R13 base address for variables in the current module SB (static base)
If you then look at the RISC5 compiler modification history you will see the following entry for 2018:

Code: Select all

20180720 - Update compiler: ORP.Mod.txt and ORG.Mod.txt
  Cash (* Cache? *) for base adr of global variables "curSB" has been removed from ORG.Mod.
  Removal of this optimization makes compiler simpler.
https://people.inf.ethz.ch/wirth/news.txt

However, I would not recommend using R13 for your own purposes unless you intend to maintain your own customised version of the RISC5 compiler as well.

gray
Posts: 109
Joined: Tue Feb 12, 2019 2:59 am
Location: Mauritius

Re: Register R13

Post by gray » Mon Feb 07, 2022 6:34 am

Thanks for the pointers. I don't have intention to change the compiler to use R13, but I am grinding my teeth on an in-circuit debugger, and an otherwise unused register could be handy from assembly code. ;)

Post Reply