Five EmbedDev logo Five EmbedDev

An Embedded RISC-V Blog
Register Assignment for each ABI.

NOTE:Early Work in progress. Not all extension registers are included here yet.

ABI Register Usage Description ABI Register Usage Description
zeroZeroraReturn address
spStack pointergpGlobal pointer
tpThread pointert0-t2, t3-t6Temporary registers
s0-s1, s2-s11Saved registersa0-a7Argument/return value

UABI

x0
zero
x8
s0
x16
a6
x24
s8
x1
ra
x9
s1
x17
a7
x25
s9
x2
sp
x10
a0
x18
s2
x26
s10
x3
gp
x11
a1
x19
s3
x27
s11
x4
tp
x12
a2
x20
s4
x28
t3
x5
t0
x13
a3
x21
s5
x29
t4
x6
t1
x14
a4
x22
s6
x30
t5
x7
t2
x15
a5
x23
s7
x31
t6

EABI

x0
zero
x4
tp
x8
s0/fp
x12
a2
x1
ra
x5
t0
x9
s1
x13
a3
x2
sp
x6
s3
x10
a0
x14
s2
x3
gp
x7
s4
x11
a1
x15
t1