added JMP absolute long and JMP absolute indirect long

This commit is contained in:
Preston Skupinski 2011-06-09 20:01:36 -04:00
parent fe0117a1e0
commit eff69c28bc
2 changed files with 25 additions and 2 deletions

2
TODO
View File

@ -9,11 +9,9 @@ Testing:
- Tests needed for the numerous other operations added
Operations Not Yet Implemented:
- 0x42 : WDM
- 0x5c : JMP absolute long
- 0x7c : JMP absolute indexed x indirect
- 0xcb : WAI
- 0xdb : STP
- 0xdc : JMP absolute indirect long
- 0xfc : JSR absolute indexed x indirect
CPU:
- More work on interrupts

25
cpu.js
View File

@ -100,6 +100,8 @@ function CPU_65816() {
0xbb : TYX, 0xaa : TAX, 0xa8 : TAY, 0x8a : TXA,
0x98 : TYA, 0x5b : TCD, 0x7b : TDC, 0x1b : TCS,
0x3b : TSC, 0x4c : JMP_absolute,
0x5c : JMP_absolute_long,
0xdc : JMP_absolute_indirect_long,
0x6c : JMP_absolute_indirect, 0x80 : BRA, 0x82 : BRL,
0xf0 : BEQ, 0xd0 : BNE, 0x90 : BCC, 0xb0 : BCS,
0x50 : BVC, 0x70 : BVS, 0x10 : BPL, 0x30 : BMI,
@ -4004,6 +4006,29 @@ var JMP_absolute_indirect = {
}
};
var JMP_absolute_long = {
bytes_required:function() {
return 4;
},
execute:function(cpu, bytes) {
cpu.r.k = bytes[2];
cpu.r.pc = (bytes[1]<<8)|bytes[0];
}
};
var JMP_absolute_indirect_long = {
bytes_required:function() {
return 3;
},
execute:function(cpu, bytes) {
var location = (bytes[1]<<8)|bytes[0];
var low_byte = cpu.mmu.read_byte(location);
var high_byte = cpu.mmu.read_byte(location+1);
cpu.r.pc = (high_byte<<8) | low_byte;
cpu.r.k = cpu.mmu.read_byte(location+2);
}
};
var JMP_absolute = {
bytes_required:function() {
return 3;