Skip to content

Commit

Permalink
Fix IAG
Browse files Browse the repository at this point in the history
  • Loading branch information
niligulmohar committed Aug 22, 2012
1 parent 9ca1f65 commit 0baa212
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/cpu.js
Expand Up @@ -512,7 +512,7 @@ CPU.prototype = {

// IAG
case 0x120:
this.set(this.get(aVal), this.mem.ia);
this.set(insn.a, this.mem.ia);
break;

// IAS
Expand Down
10 changes: 5 additions & 5 deletions test/cpu_test.js
Expand Up @@ -804,11 +804,11 @@ module.exports = {
// assert.equal(cpu.cycle, 4);
// },

// 'IAG should get the value of IA': function () {
// var cpu = runOnCpu("IAS 0x42",
// "IAG a");
// assert.equal(cpu.get("a"), 0x42);
// },
'IAG should get the value of IA': function () {
var cpu = runOnCpu("IAS 0x42",
"IAG a");
assert.equal(cpu.get("a"), 0x42);
},

'IAG with no next word value should take one cycle to perform': function () {
var cpu = runOnCpu("IAG a");
Expand Down

0 comments on commit 0baa212

Please sign in to comment.