gensys.sh - scc - simple c99 compiler
(HTM) git clone git://git.simple-cc.org/scc
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
gensys.sh (331B)
---
1 #!/bin/sh
2
3 # This job is very easy because app and kernel ABI are identical
4 # until the 4th parameter, so we only have to set the syscall
5 # number in rax
6
7 sed -n "
8 s/[ ]*#.*//
9 /$1/p" syscall.lst |
10 while read num name
11 do
12 cat <<EOF > $name.s
13 .file "$name.s"
14
15 .globl $name
16 $name:
17 mov x8,#$num
18 svc 0
19 b _cerrno
20 EOF
21 done