Register R13

General discussions about using the Astrobe IDE to program the FPGA RISC5 cpu used in Project Oberon 2013
Post Reply
gray
Posts: 143
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: 525
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)
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.

gray
Posts: 143
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