c278881d66789b38f330a946fbd8a820e59d5e9a
[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
16 #    print "\tFCB\t\$$3, \$$5, \$$7, \$$9\n";
17     next LINE;
18   }
19 #  if (/^([A-F0-9]{4}) (([A-F0-9]{2}) )(([A-F0-9]{2}) )(([A-F0-9]{2}) )/) {
20 #    print ";$_";
21 #    print "\tFCB\t\$$3, \$$5, \$$7\n";
22 #    next LINE;
23 #  }
24 #  if (/^([A-F0-9]{4}) (([A-F0-9]{2}) )(([A-F0-9]{2}) )/) {
25 #    print ";$_";
26 #    print "\tFCB\t\$$3, \$$5\n";
27 #    next LINE;
28 #  }
29 #  if (/^([A-F0-9]{4}) ([A-F0-9]{2})/) {
30 #    print ";$_";
31 #    print "\tFCB\t\$$2\n";
32 #    next LINE;
33 #  }
34   if (/^\cZ$/) { next LINE; }
35   print ";$_";
36 }

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