added JMP absolute long and JMP absolute indirect long
This commit is contained in:
parent
fe0117a1e0
commit
eff69c28bc
2
TODO
2
TODO
|
@ -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
25
cpu.js
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue