#!/usr/bin/perl -w

use strict;

print STDERR "hex-file2binary converter.\n";


while (<>) {
	last if $_ =~ /:00000001FF/;
	my @line = $_ =~ /([0-9A-Fa-f]{2})/g;

	# intel address 16Bit address
	my $t = $line[1];
	$line[1] = $line[2];
	$line[2] = $t;

	foreach (@line) {
		printf "%c", eval "0x$_";
	}
}
