mirror of
https://github.com/pskupinski/65816.js.git
synced 2024-06-12 06:29:30 +00:00
check if transferred value is zero and set the z bit of the p status register
This commit is contained in:
parent
b167d4c164
commit
93ae3ec6a0
28
cpu.js
28
cpu.js
|
@ -115,7 +115,11 @@ var TYA = {
|
|||
// 8-bit index register to 16-bit accumulator.
|
||||
// 16-bit index register to 16-bit accumulator.
|
||||
cpu.r.a = cpu.r.y;
|
||||
}
|
||||
}
|
||||
if(cpu.r.a===0) {
|
||||
cpu.p.z = 1;
|
||||
}
|
||||
// TODO: Set n bit of the p status register.
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -142,6 +146,10 @@ var TAY = {
|
|||
cpu.r.y = cpu.r.a;
|
||||
}
|
||||
}
|
||||
if(cpu.r.y===0) {
|
||||
cpu.p.z = 1;
|
||||
}
|
||||
// TODO: Set n bit of the p status register.
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -163,7 +171,11 @@ var TXA = {
|
|||
// 8-bit index register to 16-bit accumulator.
|
||||
// 16-bit index register to 16-bit accumulator.
|
||||
cpu.r.a = cpu.r.x;
|
||||
}
|
||||
}
|
||||
if(cpu.r.a===0) {
|
||||
cpu.p.z = 1;
|
||||
}
|
||||
// TODO: Set n bit of the p status register.
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -190,6 +202,10 @@ var TAX = {
|
|||
cpu.r.x = cpu.r.a;
|
||||
}
|
||||
}
|
||||
if(cpu.r.x===0) {
|
||||
cpu.p.z = 1;
|
||||
}
|
||||
// TODO: Set n bit of the p status register.
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -199,6 +215,10 @@ var TXY = {
|
|||
},
|
||||
execute:function(cpu) {
|
||||
cpu.r.y = cpu.r.x;
|
||||
if(cpu.r.y===0) {
|
||||
cpu.p.z = 1;
|
||||
}
|
||||
// TODO: Set n bit of the p status register.
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -208,6 +228,10 @@ var TYX = {
|
|||
},
|
||||
execute:function(cpu) {
|
||||
cpu.r.y = cpu.r.x;
|
||||
if(cpu.r.y===0) {
|
||||
cpu.p.z = 1;
|
||||
}
|
||||
// TODO: Set n bit of the p status register.
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user