+
+# Process one instruction
+# Usage: instruction line
+sub instruction {
+ my ($line) = @_;
+ print ";$line";
+
+ $instruction = substr($line,5,2);
+
+ if (defined $transtable{$instruction}) {
+ print "\t$transtable{$instruction}";
+ $line =~ /$transtable{$instruction}(.*)$/i;
+ print "$1\n";
+ return;
+ }
+
+ if (defined $twobytefirst{$instruction}) {
+ $thing = substr($line,5,5);
+ if (defined $twobytesecond{$thing}) {
+ print "\t" . $twobytesecond{$thing};
+ $line =~ /$twobytesecond{$thing}(.*)$/i;
+ print "$1\n";
+ return;
+ }
+ }
+
+ if (defined $onewitharg{$instruction}) {
+ $thing = substr($line,8,2);
+ print "\t$onewitharg{$instruction}\t#\$$thing";
+ $line =~ /$onewitharg{$instruction} [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";
+ }
+}