2
# Translate the assembler syntax of arm assembler programs
3
# Usage: asmarm < riscix-asm-file > portable-asm-file
4
# The portable-asm-file has to be
6
# 2. grep -v '^ *#line' | grep -v '^#'
7
# 3. sed -e 's,% ,%,g' -e 's,//,@,g' -e 's,\$,#,g'
11
tmpremove='rm -f $tmpscript1 $tmpscript2'
12
trap "$tmpremove" 1 2 15
14
cat > $tmpscript1 << \EOF
15
# ----------- Remove gcc self-identification
20
cat > $tmpscript2 << \EOF
21
# ----------- Hide comments, to avoid trouble in preprocessing
23
# ----------- Turn # into $, to avoid trouble in preprocessing
25
# ----------- Declare global symbols as functions (we have no variables)
26
s/\.global _\([A-Za-z0-9_]*\)$/.global _\1\
28
# ----------- Global symbols depends on ASM_UNDERSCORE
29
s/_\([A-Za-z0-9_:]*\)/C(\1)/
32
sed -f $tmpscript1 | \