Put the syscall number in register a7, the first argument in a0, second argument in a1 and so on. Look in the manual pages for the syscalls to see what the arguments are.
This code calls exit(0)
.
li a7, 93
li a0, 0
ecall
Dec | Hex | Name |
---|---|---|
0 | 0 | io_setup |
1 | 1 | io_destroy |
2 | 2 | io_submit |
3 | 3 | io_cancel |
4 | 4 | io_getevents |
5 | 5 | setxattr |
6 | 6 | lsetxattr |
7 | 7 | fsetxattr |
8 | 8 | getxattr |
9 | 9 | lgetxattr |
10 | A | fgetxattr |
11 | B | listxattr |
12 | C | llistxattr |
13 | D | flistxattr |
14 | E | removexattr |
15 | F | lremovexattr |
16 | 10 | fremovexattr |
17 | 11 | getcwd |
18 | 12 | lookup_dcookie |
19 | 13 | eventfd2 |
20 | 14 | epoll_create1 |
21 | 15 | epoll_ctl |
22 | 16 | epoll_pwait |
23 | 17 | dup |
24 | 18 | dup3 |
25 | 19 | fcntl |
26 | 1A | inotify_init1 |
27 | 1B | inotify_add_watch |
28 | 1C | inotify_rm_watch |
29 | 1D | ioctl |
30 | 1E | ioprio_set |
31 | 1F | ioprio_get |
32 | 20 | flock |
33 | 21 | mknodat |
34 | 22 | mkdirat |
35 | 23 | unlinkat |
36 | 24 | symlinkat |
37 | 25 | linkat |
38 | 26 | renameat |
39 | 27 | umount2 |
40 | 28 | mount |
41 | 29 | pivot_root |
42 | 2A | nfsservctl |
43 | 2B | statfs |
44 | 2C | fstatfs |
45 | 2D | truncate |
46 | 2E | ftruncate |
47 | 2F | fallocate |
48 | 30 | faccessat |
49 | 31 | chdir |
50 | 32 | fchdir |
51 | 33 | chroot |
52 | 34 | fchmod |
53 | 35 | fchmodat |
54 | 36 | fchownat |
55 | 37 | fchown |
56 | 38 | openat |
57 | 39 | close |
58 | 3A | vhangup |
59 | 3B | pipe2 |
60 | 3C | quotactl |
61 | 3D | getdents64 |
62 | 3E | lseek |
63 | 3F | read |
64 | 40 | write |
65 | 41 | readv |
66 | 42 | writev |
67 | 43 | pread64 |
68 | 44 | pwrite64 |
69 | 45 | preadv |
70 | 46 | pwritev |
71 | 47 | sendfile |
72 | 48 | pselect6 |
73 | 49 | ppoll |
74 | 4A | signalfd4 |
75 | 4B | vmsplice |
76 | 4C | splice |
77 | 4D | tee |
78 | 4E | readlinkat |
79 | 4F | newfstatat |
80 | 50 | fstat |
81 | 51 | sync |
82 | 52 | fsync |
83 | 53 | fdatasync |
84 | 54 | sync_file_range |
85 | 55 | timerfd_create |
86 | 56 | timerfd_settime |
87 | 57 | timerfd_gettime |
88 | 58 | utimensat |
89 | 59 | acct |
90 | 5A | capget |
91 | 5B | capset |
92 | 5C | personality |
93 | 5D | exit |
94 | 5E | exit_group |
95 | 5F | waitid |
96 | 60 | set_tid_address |
97 | 61 | unshare |
98 | 62 | futex |
99 | 63 | set_robust_list |
100 | 64 | get_robust_list |
101 | 65 | nanosleep |
102 | 66 | getitimer |
103 | 67 | setitimer |
104 | 68 | kexec_load |
105 | 69 | init_module |
106 | 6A | delete_module |
107 | 6B | timer_create |
108 | 6C | timer_gettime |
109 | 6D | timer_getoverrun |
110 | 6E | timer_settime |
111 | 6F | timer_delete |
112 | 70 | clock_settime |
113 | 71 | clock_gettime |
114 | 72 | clock_getres |
115 | 73 | clock_nanosleep |
116 | 74 | syslog |
117 | 75 | ptrace |
118 | 76 | sched_setparam |
119 | 77 | sched_setscheduler |
120 | 78 | sched_getscheduler |
121 | 79 | sched_getparam |
122 | 7A | sched_setaffinity |
123 | 7B | sched_getaffinity |
124 | 7C | sched_yield |
125 | 7D | sched_get_priority_max |
126 | 7E | sched_get_priority_min |
127 | 7F | sched_rr_get_interval |
128 | 80 | restart_syscall |
129 | 81 | kill |
130 | 82 | tkill |
131 | 83 | tgkill |
132 | 84 | sigaltstack |
133 | 85 | rt_sigsuspend |
134 | 86 | rt_sigaction |
135 | 87 | rt_sigprocmask |
136 | 88 | rt_sigpending |
137 | 89 | rt_sigtimedwait |
138 | 8A | rt_sigqueueinfo |
139 | 8B | rt_sigreturn |
140 | 8C | setpriority |
141 | 8D | getpriority |
142 | 8E | reboot |
143 | 8F | setregid |
144 | 90 | setgid |
145 | 91 | setreuid |
146 | 92 | setuid |
147 | 93 | setresuid |
148 | 94 | getresuid |
149 | 95 | setresgid |
150 | 96 | getresgid |
151 | 97 | setfsuid |
152 | 98 | setfsgid |
153 | 99 | times |
154 | 9A | setpgid |
155 | 9B | getpgid |
156 | 9C | getsid |
157 | 9D | setsid |
158 | 9E | getgroups |
159 | 9F | setgroups |
160 | A0 | uname |
161 | A1 | sethostname |
162 | A2 | setdomainname |
163 | A3 | getrlimit |
164 | A4 | setrlimit |
165 | A5 | getrusage |
166 | A6 | umask |
167 | A7 | prctl |
168 | A8 | getcpu |
169 | A9 | gettimeofday |
170 | AA | settimeofday |
171 | AB | adjtimex |
172 | AC | getpid |
173 | AD | getppid |
174 | AE | getuid |
175 | AF | geteuid |
176 | B0 | getgid |
177 | B1 | getegid |
178 | B2 | gettid |
179 | B3 | sysinfo |
180 | B4 | mq_open |
181 | B5 | mq_unlink |
182 | B6 | mq_timedsend |
183 | B7 | mq_timedreceive |
184 | B8 | mq_notify |
185 | B9 | mq_getsetattr |
186 | BA | msgget |
187 | BB | msgctl |
188 | BC | msgrcv |
189 | BD | msgsnd |
190 | BE | semget |
191 | BF | semctl |
192 | C0 | semtimedop |
193 | C1 | semop |
194 | C2 | shmget |
195 | C3 | shmctl |
196 | C4 | shmat |
197 | C5 | shmdt |
198 | C6 | socket |
199 | C7 | socketpair |
200 | C8 | bind |
201 | C9 | listen |
202 | CA | accept |
203 | CB | connect |
204 | CC | getsockname |
205 | CD | getpeername |
206 | CE | sendto |
207 | CF | recvfrom |
208 | D0 | setsockopt |
209 | D1 | getsockopt |
210 | D2 | shutdown |
211 | D3 | sendmsg |
212 | D4 | recvmsg |
213 | D5 | readahead |
214 | D6 | brk |
215 | D7 | munmap |
216 | D8 | mremap |
217 | D9 | add_key |
218 | DA | request_key |
219 | DB | keyctl |
220 | DC | clone |
221 | DD | execve |
222 | DE | mmap |
223 | DF | fadvise64 |
224 | E0 | swapon |
225 | E1 | swapoff |
226 | E2 | mprotect |
227 | E3 | msync |
228 | E4 | mlock |
229 | E5 | munlock |
230 | E6 | mlockall |
231 | E7 | munlockall |
232 | E8 | mincore |
233 | E9 | madvise |
234 | EA | remap_file_pages |
235 | EB | mbind |
236 | EC | get_mempolicy |
237 | ED | set_mempolicy |
238 | EE | migrate_pages |
239 | EF | move_pages |
240 | F0 | rt_tgsigqueueinfo |
241 | F1 | perf_event_open |
242 | F2 | accept4 |
243 | F3 | recvmmsg |
260 | 104 | wait4 |
261 | 105 | prlimit64 |
262 | 106 | fanotify_init |
263 | 107 | fanotify_mark |
264 | 108 | name_to_handle_at |
265 | 109 | open_by_handle_at |
266 | 10A | clock_adjtime |
267 | 10B | syncfs |
268 | 10C | setns |
269 | 10D | sendmmsg |
270 | 10E | process_vm_readv |
271 | 10F | process_vm_writev |
272 | 110 | kcmp |
273 | 111 | finit_module |
274 | 112 | sched_setattr |
275 | 113 | sched_getattr |
276 | 114 | renameat2 |
277 | 115 | seccomp |
278 | 116 | getrandom |
279 | 117 | memfd_create |
280 | 118 | bpf |
281 | 119 | execveat |
282 | 11A | userfaultfd |
283 | 11B | membarrier |
284 | 11C | mlock2 |
285 | 11D | copy_file_range |
286 | 11E | preadv2 |
287 | 11F | pwritev2 |
288 | 120 | pkey_mprotect |
289 | 121 | pkey_alloc |
290 | 122 | pkey_free |
291 | 123 | statx |
292 | 124 | io_pgetevents |
293 | 125 | rseq |
294 | 126 | kexec_file_load |