Undocumented 6502 instruction RLA added.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2018-01-07 22:50:14 +00:00
parent 31524929c3
commit 65b856611e
3 changed files with 20 additions and 3 deletions

View File

@ -594,6 +594,17 @@ namespace EightBit {
ORA(operand); ORA(operand);
} }
void ANDA(uint8_t value) {
adjustNZ(A() &= value);
}
void RLA(int bbb) {
auto operand = AM_01(bbb);
ROL(operand);
setByte(operand);
ANDA(operand);
}
void ROR(uint8_t& output); void ROR(uint8_t& output);
void LSR(uint8_t& output); void LSR(uint8_t& output);

View File

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

View File

@ -7,8 +7,8 @@ EightBit::MOS6502::MOS6502(Bus& bus)
//// 0 1 2 3 4 5 6 7 8 9 A B C D E F //// 0 1 2 3 4 5 6 7 8 9 A B C D E F
/* 0 */ 7, 6, 0, 8, 3, 3, 5, 5, 3, 2, 2, 0, 4, 4, 6, 6, /* 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, /* 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, /* 2 */ 6, 6, 0, 8, 3, 3, 5, 5, 4, 2, 2, 0, 4, 4, 6, 6,
/* 3 */ 2, 5, 0, 0, 4, 4, 6, 0, 2, 4, 2, 0, 4, 4, 7, 0, /* 3 */ 2, 5, 0, 7, 4, 4, 6, 6, 2, 4, 2, 6, 4, 4, 7, 6,
/* 4 */ 6, 6, 0, 0, 3, 3, 5, 0, 3, 2, 2, 0, 3, 4, 6, 0, /* 4 */ 6, 6, 0, 0, 3, 3, 5, 0, 3, 2, 2, 0, 3, 4, 6, 0,
/* 5 */ 2, 5, 0, 0, 4, 4, 6, 0, 2, 4, 2, 0, 4, 4, 7, 0, /* 5 */ 2, 5, 0, 0, 4, 4, 6, 0, 2, 4, 2, 0, 4, 4, 7, 0,
/* 6 */ 6, 6, 0, 0, 3, 3, 5, 0, 4, 2, 2, 0, 5, 4, 6, 0, /* 6 */ 6, 6, 0, 0, 3, 3, 5, 0, 4, 2, 2, 0, 5, 4, 6, 0,
@ -297,7 +297,7 @@ int EightBit::MOS6502::execute(uint8_t cell) {
ORA(AM_01(decoded.bbb)); ORA(AM_01(decoded.bbb));
break; break;
case 0b001: // AND case 0b001: // AND
adjustNZ(A() &= AM_01(decoded.bbb)); ANDA(AM_01(decoded.bbb));
break; break;
case 0b010: // EOR case 0b010: // EOR
adjustNZ(A() ^= AM_01(decoded.bbb)); adjustNZ(A() ^= AM_01(decoded.bbb));
@ -414,6 +414,9 @@ int EightBit::MOS6502::execute(uint8_t cell) {
case 0b000: // *SLO case 0b000: // *SLO
SLO(decoded.bbb); SLO(decoded.bbb);
break; break;
case 0b001: // *RLA
RLA(decoded.bbb);
break;
case 0b100: // *SAX case 0b100: // *SAX
AM_11(decoded.bbb, A() & X()); AM_11(decoded.bbb, A() & X());
break; break;