Five EmbedDev logo Five EmbedDev

An Embedded RISC-V Blog

Introduction

Register Assignment for each ABI.

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

The canonical ABI References are on the RISC-V GitHub:

Register Types

ABI Register Usage Description Saver ABI Register Usage Description Saver
zero Zero immutable ra Return address not_applicable
sp Stack pointer callee gp Global pointer global
tp Thread pointer global t0-t2, t3-t6 Temporary registers none
s0-s1, s2-s11 Saved registers callee a0-a7 Argument/return value caller

UABI

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

EABI

x0
zero
x5
t0
x10
a0
x14
s2
x16
s5
x1
ra
x6
s3
x11
a1
x15
t1
x17
s6
x2
sp
x7
s4
x12
a2
x18
s7
x3
gp
x8
s0/fp
x13
a3
x19
s8
x4
tp
x9
s1
x20
s9
x21
s10
x22
s11
x23
s12
x24
s13
x25
s14
x26
s15
x27
s16
x28
s17
x29
s18
x30
s19
x31
s20