Undocumented instruction: SLO added

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2018-01-04 22:46:44 +00:00
parent cb89eb8c82
commit 5c3568aebd
3 changed files with 20 additions and 3 deletions

View File

@ -583,6 +583,17 @@ namespace EightBit {
A() = SBC(A(), operand);
}
void ORA(uint8_t value) {
adjustNZ(A() |= value);
}
void SLO(int bbb) {
auto operand = AM_01(bbb);
ASL(operand);
setByte(operand);
ORA(operand);
}
void ROR(uint8_t& output);
void LSR(uint8_t& output);

View File

@ -389,6 +389,9 @@ std::string EightBit::Disassembly::disassemble(uint16_t current) const {
break;
case 0b11:
switch (aaa) {
case 0b000:
output << disassemble_AM_01(bbb, "*SLO");
break;
case 0b100:
output << disassemble_AM_11(bbb, "*SAX");
break;

View File

@ -5,8 +5,8 @@ EightBit::MOS6502::MOS6502(Bus& bus)
: Processor(bus) {
m_timings = {
//// 0 1 2 3 4 5 6 7 8 9 A B C D E F
/* 0 */ 7, 6, 0, 0, 3, 3, 5, 0, 3, 2, 2, 0, 4, 4, 6, 0,
/* 1 */ 2, 5, 0, 0, 4, 4, 6, 0, 2, 4, 2, 0, 4, 4, 7, 0,
/* 0 */ 7, 6, 0, 8, 3, 3, 5, 5, 3, 2, 2, 0, 4, 4, 6, 6,
/* 1 */ 2, 5, 0, 7, 4, 4, 6, 6, 2, 4, 2, 6, 4, 4, 7, 6,
/* 2 */ 6, 6, 0, 0, 3, 3, 5, 0, 4, 2, 2, 0, 4, 4, 6, 0,
/* 3 */ 2, 5, 0, 0, 4, 4, 6, 0, 2, 4, 2, 0, 4, 4, 7, 0,
/* 4 */ 6, 6, 0, 0, 3, 3, 5, 0, 3, 2, 2, 0, 3, 4, 6, 0,
@ -294,7 +294,7 @@ int EightBit::MOS6502::execute(uint8_t cell) {
case 0b01:
switch (decoded.aaa) {
case 0b000: // ORA
adjustNZ(A() |= AM_01(decoded.bbb));
ORA(AM_01(decoded.bbb));
break;
case 0b001: // AND
adjustNZ(A() &= AM_01(decoded.bbb));
@ -411,6 +411,9 @@ int EightBit::MOS6502::execute(uint8_t cell) {
break;
case 0b11:
switch (decoded.aaa) {
case 0b000: // *SLO
SLO(decoded.bbb);
break;
case 0b100: // *SAX
AM_11(decoded.bbb, A() & X());
break;