Hi,
I'm writing an assembly macro to a C-program, and being quite new with this I have gotten stuck on something. I'm trying to write a macro for moving data from a general purpose register to a special purpose register.
My problem is that the syntax I've found to move data from a GPR to an SPR takes a constant SPR value, while I want to use a variable one stored in another register.
# SPR is constant, rA is the value to be written
mtspr SPR, rA
I'm after something that looks like this:
# rA contains the number of the SPR, and rB the value to be moved.
AWESOMEmtspr rA, rB
Is there a reason there is no such macro available, and how would I make it myself?
Many thanks in advance.
---- Edit: ---- As it looks now I have a giant switch case in my C-code that jumps to the correct mtspr-section. I have twenty-some sections for reading and writing specifit SPR:s that each look exactly the same, but differ by a constant value.