1 #!/usr/local/bin/perl -w
3 print "\tORG\t\$8000\n";
7 # if blank line, print blank line
8 if (/^\s*$/) { print "\n"; next LINE; }
10 # if comment line, pass straight through
11 if (/^\s*;/) { print; next LINE; }
13 # if duplicate label - rename uniquely
14 if (/^\s*((loop|jump82|goto91):)/) { print "${1}_$.\n"; next LINE; }
16 # if it's a label, print label
17 if (/^\s*(\w*:)/) { print "$1\n"; next LINE; }
19 # if it's a vector table, print words
20 if (/^\t\.word\t([a-f0-9]{4})$/) { print "\tFDB\t\$\U$1\n"; next LINE; }
22 # otherwise, catch all, print bytes
23 if (/^([A-F0-9]{4}) ((([A-F0-9]{2}) )*[A-F0-9]{2})/) {
26 print "\tFCB\t\$".join(', $',@_)."\n";
30 # if control Z, remove it
31 if (/^\cZ$/) { next LINE; }
33 # FINAL print commented out