2
# Translate the assembler syntax of sparc assembler programs
3
# Usage: asmsparc < sunos4-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,//.*$,,' -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
# ----------- Turn # into $, to avoid trouble in preprocessing
23
# ----------- Declare global symbols as functions (we have no variables)
24
s/\.global _\([A-Za-z0-9_]*\)$/.global _\1\
26
# ----------- Global symbols depends on ASM_UNDERSCORE
27
s/_\([A-Za-z0-9_:]*\)/C(\1)/
30
sed -f $tmpscript1 | \