Permalink
Browse files

get disassembler fix.

  • Loading branch information...
1 parent d442c7c commit 661319a904ae45af5621274ad3902c702d68f38f @robey committed Feb 24, 2013
Showing with 8 additions and 5 deletions.
  1. +8 −5 js/lib/d16asm.js
View
@@ -790,16 +790,19 @@ var exports = {};
opcode = b;
b = null;
opname = Dcpu.SpecialOpNames[opcode];
- } else {
- opname = Dcpu.BinaryOpNames[opcode];
if (opname != null) {
- bArgument = this.hasImmediate[b] ? this.nextWord() : void 0;
+ aArgument = this.hasImmediate[a] ? this.nextWord() : void 0;
} else {
null;
}
+ } else {
+ opname = Dcpu.BinaryOpNames[opcode];
+ if (opname != null) {
+ aArgument = this.hasImmediate[a] ? this.nextWord() : null;
+ bArgument = this.hasImmediate[b] ? this.nextWord() : null;
+ }
}
if (opname != null) {
- aArgument = this.hasImmediate[a] ? this.nextWord() : null;
if (a >= 0x20) {
aArgument = (a - 0x21) & 0xffff;
a = Operand.Immediate;
@@ -2352,7 +2355,7 @@ var exports = {};
break;
default:
line.pointTo(m);
- line.fail("Unknown directive: " + directive);
+ line.fail("Unknown directive: " + pline.directive);
}
return true;
};

0 comments on commit 661319a

Please sign in to comment.