#!/bin/sh
if [ $# -ne 2 ]; then echo "Usage: `basename $0` file1 file2"; exit 1; fi
echo "Comparing \"$1\" and \"$2\" using cmp"
cmp -l "$1" "$2"|while read o a b; do printf "%06X %02X %02X\n" $o $a $b; done

echo "Comparing \"$1\" and \"$2\" using od and diff"
a=$(mktemp)
b=$(mktemp)
od -A x -t x1 -v -w1 "$1" > $a
od -A x -t x1 -v -w1 "$2" > $b
diff -y --suppress-common-lines -t $a $b | sed -e "s/ *| *[0-9A-F]* / /"
rm $a $b
