1 #!/usr/local/bin/perl -w
3 print "\tORG\t\$8000\n";
5 my %transtable = ( '02' => 'IDIV' ,
45 # if blank line, print blank line
46 if (/^\s*$/) { print "\n"; next LINE; }
48 # if comment line, pass straight through
49 if (/^\s*;/) { print; next LINE; }
51 # if duplicate label - rename uniquely
52 if (/^\s*((loop|jump82|goto91):)/) { print "${1}_$.\n"; next LINE; }
54 # if it's a label, print label
55 if (/^\s*(\w*:)/) { print "$1\n"; next LINE; }
57 # if it's a vector table, print words
58 if (/^\t\.word\t([a-f0-9]{4})$/) { print "\tFDB\t\$\U$1\n"; next LINE; }
60 # otherwise, catch all, print bytes
61 if (/^([A-F0-9]{4}) ((([A-F0-9]{2}) )*[A-F0-9]{2})/) {
66 # if control Z, remove it
67 if (/^\cZ$/) { next LINE; }
69 # FINAL print commented out
73 # Process one instruction
74 # Usage: instruction line
79 $instruction = substr($line,5,2);
81 if (defined $transtable{$instruction}) {
82 print "\t$transtable{$instruction}";
83 $line =~ /$transtable{$instruction}(.*)$/i;
88 # FIXME: parse instruction
89 #if (defined($transtable{$instruction})) {
90 # print "\t$transtable{$instruction}";
91 # if (defined($comment)) { print "; $comment"; }
101 # } elsif ($l != 33) {
106 # $addr = substr($_,0,4);
107 # $inst = substr($_,27,3);
108 # $val = substr($_,31,2);
111 # $daddr = (hex $addr) + 2 + convert($val);
114 # if (defined $commands{$inst}) {
116 # printf "%4X", $daddr;
117 # #print " $addr $inst $val\n";
122 if ($line =~ /^([A-F0-9]{4}) ((([A-F0-9]{2}) )*[A-F0-9]{2})/) {
124 print "\tFCB\t\$".join(', $',@_)."\n";