asmmips.sh

来自「FinC编译器源代码」· Shell 代码 · 共 32 行

SH
32
字号
#!/bin/sh# Translate the assembler syntax of mips assembler programs# Usage: asmmips < irix-asm-file > portable-asm-file# The portable-asm-file has to be#   1. preprocessed,#   2. grep -v '^ *#line' | grep -v '^#'#   3. sed -e 's,% ,%,g' -e 's,//.*$,,'tmpscript1=sed$$tmp1tmpscript2=sed$$tmp2tmpremove='rm -f $tmpscript1 $tmpscript2'trap "$tmpremove" 1 2 15cat > $tmpscript1 << \EOF# ----------- Remove gcc self-identification/gcc2_compiled/d/gnu_compiled_c/dEOFcat > $tmpscript2 << \EOF# ----------- Remove comments, they would cause trouble in preprocessings,#.*$,,# ----------- Declare global symbols as functions (we have no variables)s/\.globl	\([A-Za-z0-9_]*\)$/.globl	\1\	DECLARE_FUNCTION(\1)/EOFsed -f $tmpscript1 | \sed -f $tmpscript2eval "$tmpremove"

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?