#!/bin/rc
# exec2hex [file...] - convert text & data segs of standalone 9 binary to C hex
#	(amd64 version)
# have to strip a.out header, which is 8 bytes bigger than on 32-bit systems.
xd -1x $* | sed -e 's/^[0-9a-f]+ //'				\
	     -e '1,2d' -e '3s/^ .. .. .. .. .. .. .. ..//'	\
	     -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
