Rizin
unix-like reverse engineering framework and cli tools
riscv64.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2020 Zi Fan <zifan.tan@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 return strdup(
5  "=PC pc\n"
6  "=SP sp\n" // ABI: stack pointer
7  "=LR ra\n" // ABI: return address
8  "=BP s0\n" // ABI: frame pointer
9  "=A0 a0\n"
10  "=A1 a1\n"
11  "=A2 a2\n"
12  "=A3 a3\n"
13  "=A4 a4\n"
14  "=A5 a5\n"
15  "=A6 a6\n"
16  "=A7 a7\n"
17  "=R0 a0\n"
18  "=R1 a1\n"
19  "=SN a7\n" // ABI: syscall numer
20  "gpr zero .64 0 0\n" // seems to be allocated in the arena too
21  // RV64I regs (ABI names)
22  // From user-Level ISA Specification, section 2.1 and 4.1
23  // "zero" has been left out as it ignores writes and always reads as zero
24  "gpr ra .64 8 0\n" // =x1
25  "gpr sp .64 16 0\n" // =x2
26  "gpr gp .64 24 0\n" // =x3
27  "gpr tp .64 32 0\n" // =x4
28  "gpr t0 .64 40 0\n" // =x5
29  "gpr t1 .64 48 0\n" // =x6
30  "gpr t2 .64 56 0\n" // =x7
31  "gpr s0 .64 64 0\n" // =x8 // fp
32  "gpr s1 .64 72 0\n" // =x9
33  "gpr a0 .64 80 0\n" // =x10
34  "gpr a1 .64 88 0\n" // =x11
35  "gpr a2 .64 96 0\n" // =x12
36  "gpr a3 .64 104 0\n" // =x13
37  "gpr a4 .64 112 0\n" // =x14
38  "gpr a5 .64 120 0\n" // =x15
39  "gpr a6 .64 128 0\n" // =x16
40  "gpr a7 .64 136 0\n" // =x17
41  "gpr s2 .64 144 0\n" // =x18
42  "gpr s3 .64 152 0\n" // =x19
43  "gpr s4 .64 160 0\n" // =x20
44  "gpr s5 .64 168 0\n" // =x21
45  "gpr s6 .64 176 0\n" // =x22
46  "gpr s7 .64 184 0\n" // =x23
47  "gpr s8 .64 192 0\n" // =x24
48  "gpr s9 .64 200 0\n" // =x25
49  "gpr s10 .64 208 0\n" // =x26
50  "gpr s11 .64 216 0\n" // =x27
51  "gpr t3 .64 224 0\n" // =x28
52  "gpr t4 .64 232 0\n" // =x29
53  "gpr t5 .64 240 0\n" // =x30
54  "gpr t6 .64 248 0\n" // =x31
55  "gpr pc .64 248 0\n");
return strdup("=PC pc\n" "=SP sp\n" "=LR ra\n" "=BP s0\n" "=A0 a0\n" "=A1 a1\n" "=A2 a2\n" "=A3 a3\n" "=A4 a4\n" "=A5 a5\n" "=A6 a6\n" "=A7 a7\n" "=R0 a0\n" "=R1 a1\n" "=SN a7\n" "gpr zero .64 0 0\n" "gpr ra .64 8 0\n" "gpr sp .64 16 0\n" "gpr gp .64 24 0\n" "gpr tp .64 32 0\n" "gpr t0 .64 40 0\n" "gpr t1 .64 48 0\n" "gpr t2 .64 56 0\n" "gpr s0 .64 64 0\n" "gpr s1 .64 72 0\n" "gpr a0 .64 80 0\n" "gpr a1 .64 88 0\n" "gpr a2 .64 96 0\n" "gpr a3 .64 104 0\n" "gpr a4 .64 112 0\n" "gpr a5 .64 120 0\n" "gpr a6 .64 128 0\n" "gpr a7 .64 136 0\n" "gpr s2 .64 144 0\n" "gpr s3 .64 152 0\n" "gpr s4 .64 160 0\n" "gpr s5 .64 168 0\n" "gpr s6 .64 176 0\n" "gpr s7 .64 184 0\n" "gpr s8 .64 192 0\n" "gpr s9 .64 200 0\n" "gpr s10 .64 208 0\n" "gpr s11 .64 216 0\n" "gpr t3 .64 224 0\n" "gpr t4 .64 232 0\n" "gpr t5 .64 240 0\n" "gpr t6 .64 248 0\n" "gpr pc .64 248 0\n")