scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#!/bin/sh
 2
 3sed -n "
 4     s/[ 	]*#.*//
 5     /$1/p" syscall.lst |
 6while read num name
 7do
 8cat <<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
19EOF
20done