title: PowerPC moving to variable SPR
body: <p>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.</p>
  
  <p>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.</p>
  
  <pre><code># SPR is constant, rA is the value to be written
  mtspr SPR, rA
  </code></pre>
  
  <p>I'm after something that looks like this:</p>
  
  <pre><code># rA contains the number of the SPR, and rB the value to be moved.
  AWESOMEmtspr rA, rB
  </code></pre>
  
  <p>Is there a reason there is no such macro available, and how would I make it myself?</p>
  
  <p>Many thanks in advance.</p>
  
  <p>---- <strong>Edit:</strong> ----
  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.</p>