mirror of
https://github.com/pskupinski/65816.js.git
synced 2024-09-23 06:03:22 +00:00
added JMP absolute indexed x indirect
This commit is contained in:
parent
26fddd8943
commit
a9e15285cb
1
TODO
1
TODO
@ -8,7 +8,6 @@ Testing:
|
||||
- Tests needed for interrupt support
|
||||
- Tests needed for the numerous other operations added
|
||||
Operations Not Yet Implemented:
|
||||
- 0x7c : JMP absolute indexed x indirect
|
||||
- 0xcb : WAI
|
||||
- 0xdb : STP
|
||||
- 0xfc : JSR absolute indexed x indirect
|
||||
|
29
cpu.js
29
cpu.js
@ -102,6 +102,7 @@ function CPU_65816() {
|
||||
0x3b : TSC, 0x4c : JMP_absolute,
|
||||
0x5c : JMP_absolute_long,
|
||||
0xdc : JMP_absolute_indirect_long,
|
||||
0x7c : JMP_absolute_indexed_x_indirect,
|
||||
0x6c : JMP_absolute_indirect, 0x80 : BRA, 0x82 : BRL,
|
||||
0xf0 : BEQ, 0xd0 : BNE, 0x90 : BCC, 0xb0 : BCS,
|
||||
0x50 : BVC, 0x70 : BVS, 0x10 : BPL, 0x30 : BMI,
|
||||
@ -4036,6 +4037,34 @@ var JMP_absolute_indirect_long = {
|
||||
}
|
||||
};
|
||||
|
||||
var JMP_absolute_indexed_x_indirect = {
|
||||
bytes_required:function() {
|
||||
return 3;
|
||||
},
|
||||
execute:function(cpu, bytes) {
|
||||
var location = ((bytes[1]<<8)|bytes[0])+cpu.r.x;
|
||||
var bank = cpu.r.k;
|
||||
if(location&0x10000) {
|
||||
bank++;
|
||||
}
|
||||
location &= 0xffff;
|
||||
var indirect_location_low_byte = cpu.mmu.read_byte_long(location, bank);
|
||||
var indirect_location_high_byte = cpu.mmu.read_byte_long(location+1, bank);
|
||||
var indirect_location = (indirect_location_high_byte<<8) |
|
||||
indirect_location_low_byte;
|
||||
var low_byte = cpu.mmu.read_byte(indirect_location);
|
||||
bank = cpu.r.k;
|
||||
if(indirect_location===0xffff) {
|
||||
indirect_location = 0;
|
||||
bank++;
|
||||
} else {
|
||||
indirect_location++;
|
||||
}
|
||||
var high_byte = cpu.mmu.read_byte_long(indirect_location, bank);
|
||||
cpu.r.pc = (high_byte<<8)|low_byte;
|
||||
}
|
||||
};
|
||||
|
||||
var JMP_absolute = {
|
||||
bytes_required:function() {
|
||||
return 3;
|
||||
|
Loading…
Reference in New Issue
Block a user