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