#! /bin/sh
#	MC68010 Tiny Monitor -- hexify - create intel hex file
#	Copyright (C) 1988 Philip L. Budne
#
#	May be freely distributed and used for non-profit use only,
#	provided this, and all other Copyright notices remain intact.
#
#	Commercial use is strictly forbidden without explicit, written
#	permission of the author.

build=`cat BUILD`
what=$1
# even bytes
e=${what}e.hex.${build}
# odd bytes
o=${what}o.hex.${build}
# 27512 EPROM
echo "m7"		>  $e
# verify some
echo "v0-2000"  	>> $e
hex -e ${what}   	>> $e
# read some back
echo "r0-20"		>> $e

# same for odd rom
echo "m7"		>  $o
echo "v0-2000"  	>> $o
hex -o ${what}   	>> $o
echo "r0-20"		>> $o

# save binary and namelist
nm ${what} | sort | uniq > ${what}.nm.$build
cp ${what}		${what}.$build
