What:

It’s an open-source, Instruction Set Architecture. While architectures like x86 are commercial, RISC is royalty free - making it really popular in academia. You code in assembly (albeit a different kind to the MIPS one). It’s:

  • Simple
  • Modular
  • Has 32 general purpose registers (x0 -> x31 - 0x is reserved for .).
  • The stack, like in MIPS, starts at high values and grows downwards.

Remember: A word is 32 bits (i.e. 4 bytes)

Registers uses

Register NumberNameDescriptionSaver
x0zerohardwired zero-
x1rareturn addressCaller
x2spstack pointerCallee
x3gpglobal pointer-
x4tpthread pointer-
x5 - x7t0 - t2temporary registersCaller
x8s0 / fpsaved registers / frame pointerCallee
x9s1saved registersCallee
x10 - x11a0 - a1function arguments / return valuesCaller
x12 - x17a2 - a7function argumentsCaller
x18 - x27s2 - s11saved registersCallee
x28 - x31t3 - t6temporary registersCaller