mirror of
https://github.com/pskupinski/65816.js.git
synced 2024-06-16 01:29:32 +00:00
added PHB and PLB
This commit is contained in:
parent
b956d2254f
commit
aa08ce700d
26
cpu.js
26
cpu.js
|
@ -125,7 +125,7 @@ function CPU_65816() {
|
|||
0x76 : ROR_direct_page_indexed_x,
|
||||
0x48 : PHA, 0x68 : PLA, 0x5a : PHY, 0x7a : PLY,
|
||||
0xda : PHX, 0xfa : PLX, 0x08 : PHP, 0x28 : PLP,
|
||||
0xf4 : PEA, 0xd4 : PEI };
|
||||
0xf4 : PEA, 0xd4 : PEI, 0x8b : PHB, 0xab : PLB };
|
||||
|
||||
/**
|
||||
* Take a raw hex string representing the program and execute it.
|
||||
|
@ -204,6 +204,30 @@ var MMU = {
|
|||
}
|
||||
};
|
||||
|
||||
var PHB = {
|
||||
bytes_required:function() {
|
||||
return 1;
|
||||
},
|
||||
execute:function(cpu) {
|
||||
cpu.mmu.store_byte(cpu.r.s--, cpu.r.dbr);
|
||||
}
|
||||
};
|
||||
|
||||
var PLB = {
|
||||
bytes_required:function() {
|
||||
return 1;
|
||||
},
|
||||
execute:function(cpu) {
|
||||
cpu.r.dbr = cpu.mmu.read_byte(++cpu.r.s);
|
||||
cpu.p.n = cpu.r.dbr >> 7;
|
||||
if(cpu.r.dbr===0) {
|
||||
cpu.p.z = 1;
|
||||
} else {
|
||||
cpu.p.z = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var PEA = {
|
||||
bytes_required:function() {
|
||||
return 3;
|
||||
|
|
Loading…
Reference in New Issue
Block a user