'18 3A' => 'ABY',
'18 3C' => 'PSHY');
-my %onewitharg = ( '80' => 'SUBA',
- '81' => 'CMPA',
- '82' => 'SBCA',
- '84' => 'ANDA',
- '85' => 'BITA',
- '86' => 'LDAA',
- '88' => 'EORA',
- '8A' => 'ORA',
- 'C0' => 'SUBB',
- 'C1' => 'CMPB',
- 'C2' => 'SBCB',
- 'C4' => 'ANDB',
- 'C5' => 'BITB',
- 'C6' => 'LDAB',
- 'C8' => 'EORB',
- 'CA' => 'ORB' );
-
+my %onewitharg = ('63' => "COM\t\$%s,X",
+ '6A' => "DEC\t\$%s,X",
+ '6C' => "INC\t\$%s,X",
+ '6D' => "TST\t\$%s,X",
+ '6E' => "JMP\t\$%s,X",
+ '6F' => "CLR\t\$%s,X",
+ '80' => "SUBA\t#\$%s",
+ '81' => "CMPA\t#\$%s",
+ '82' => "SBCA\t#\$%s",
+ '84' => "ANDA\t#\$%s",
+ '85' => "BITA\t#\$%s",
+ '86' => "LDAA\t#\$%s",
+ '88' => "EORA\t#\$%s",
+ '8A' => "ORA\t#\$%s",
+ 'A3' => "SUBD\t\$%s,X",
+ 'A7' => "STA\t\$%s,X",
+ 'C0' => "SUBB\t#\$%s",
+ 'C1' => "CMPB\t#\$%s",
+ 'C2' => "SBCB\t#\$%s",
+ 'C4' => "ANDB\t#\$%s",
+ 'C5' => "BITB\t#\$%s",
+ 'C6' => "LDAB\t#\$%s",
+ 'C8' => "EORB\t#\$%s",
+ 'CA' => "ORB\t#\$%s",
+ 'E3' => "ADDD\t\$%s,X",
+ 'EC' => "LDD\t\$%s,X",
+ 'ED' => "STAD\t\$%s,X" );
+
+
+my %onewithword = ('FF' => "STX\t\$%s%s");
LINE: while (<>) {
if (defined $onewitharg{$instruction}) {
$thing = substr($line,8,2);
- print "\t$onewitharg{$instruction}\t#\$$thing";
+ printf "\t$onewitharg{$instruction}", $thing;
$line =~ /$onewitharg{$instruction} [0-9A-F][0-9A-F](.*)$/i;
print "\t;$1\n";
return;
}
+ if (defined $onewithword{$instruction}) {
+ $thing = substr($line,8,2);
+ $thing2 = substr($line,11,2);
+ printf "\t$onewithword{$instruction}", $thing, $thing2;
+ $line =~ /$onewithword{$instruction} [0-9A-F][0-9A-F][0-9A-F][0-9A-F](.*)$/i;
+ print "\t;$1\n";
+ return;
+ }
+
if ($line =~ /^([A-F0-9]{4}) ((([A-F0-9]{2}) )*[A-F0-9]{2})/) {
@_=split(' ',$2);
print "\tFCB\t\$".join(', $',@_)."\n";