scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

gensys.sh (220B)


      1 #!/bin/sh
      2 
      3 sed -n "
      4      s/[ 	]*#.*//
      5      /$1/p" syscall.lst |
      6 while read num name
      7 do
      8 cat <<EOF > $name.s
      9 	.file	"$name.s"
     10 
     11 	.globl	$name
     12 	.arm
     13 $name:
     14 	push	{r7,lr}
     15 	ldr	r7,=$num
     16 	swi	0
     17 	pop	{r7,lr}
     18 	b	_cerrno
     19 EOF
     20 done