Page 1 of 1

Register R13

Posted: Fri Feb 04, 2022 9:13 am
by gray
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?

Re: Register R13

Posted: Fri Feb 04, 2022 10:34 am
by cfbsoftware
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)
However, the RISC5 compiler modification history states:

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.
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.

Re: Register R13

Posted: Mon Feb 07, 2022 6:34 am
by gray
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. ;)