mirror of
https://github.com/pskupinski/65816.js.git
synced 2024-06-28 06:29:27 +00:00
added PHB and PLB
This commit is contained in:
parent
b956d2254f
commit
aa08ce700d
28
cpu.js
28
cpu.js
|
@ -123,9 +123,9 @@ function CPU_65816() {
|
||||||
0x6e : ROR_absolute, 0x66 : ROR_direct_page,
|
0x6e : ROR_absolute, 0x66 : ROR_direct_page,
|
||||||
0x7e : ROR_absolute_indexed_x,
|
0x7e : ROR_absolute_indexed_x,
|
||||||
0x76 : ROR_direct_page_indexed_x,
|
0x76 : ROR_direct_page_indexed_x,
|
||||||
0x48 : PHA , 0x68 : PLA, 0x5a : PHY, 0x7a : PLY,
|
0x48 : PHA, 0x68 : PLA, 0x5a : PHY, 0x7a : PLY,
|
||||||
0xda : PHX, 0xfa : PLX, 0x08 : PHP, 0x28 : PLP,
|
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.
|
* 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 = {
|
var PEA = {
|
||||||
bytes_required:function() {
|
bytes_required:function() {
|
||||||
return 3;
|
return 3;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user