Removed old commented, repetition
[uccvend-snackrom.git] / ROM / makeasm.pl
1 #!/usr/local/bin/perl -w
2
3 print "\tORG\t\$8000\n";
4
5 LINE: while (<>) {
6   if (/^\s*$/) { print "\n"; next LINE; }
7   if (/^\s*;/) { print; next LINE; }
8   if (/^\s*((loop|jump82|goto91):)/) { print "${1}_$.\n"; next LINE; }
9   if (/^\s*(\w*:)/) { print "$1\n"; next LINE; }
10   if (/^\t\.word\t([a-f0-9]{4})$/) { print "\tFDB\t\$\U$1\n"; next LINE; }
11   if (/^([A-F0-9]{4}) ((([A-F0-9]{2}) )*[A-F0-9]{2})/) {
12     print ";$_";
13     @_=split(' ',$2);
14     print "\tFCB\t\$".join(', $',@_)."\n";
15     next LINE;
16   }
17   if (/^\cZ$/) { next LINE; }
18   print ";$_";
19 }

UCC git Repository :: git.ucc.asn.au