#!/tools2/perl/bin/perl # Perl script for converting the output of MPASM's "Dissassembled" mode # into a ROM file. # # We need to: # Look for any line with 2 hex numbers on it starting in column 1 # Rewrite that line, with a '@' at the start of the line. while (<>) { if (/^([0-9A-Fa-f]+)\s+([0-9A-Fa-f]+)/) { $address = hex($1); $data = hex($2); printf ("@%03X %03X\n", $address, $data); } }