#!/bin/bash if test x"$1" = "x"; then echo "Need one argument" exit 1 fi cc -m32 -c "$1".c mv "$1".o "$1"-32.o cc -m64 -c "$1".c mv "$1".o "$1"-64.o objdump -d "$1"-32.o > "$1"-32.s objdump -d "$1"-64.o > "$1"-64.s grep ' [0-9 ][0-9]:' "$1"-32.s | cut -d' ' -f2 > "$1"-32.hex grep ' [0-9 ][0-9]:' "$1"-64.s | cut -d' ' -f2 > "$1"-64.hex