mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-21 21:30:31 +00:00
Add undocumented 6502 instruction: SRE
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
65b856611e
commit
4d9c0b490a
@ -605,6 +605,17 @@ namespace EightBit {
|
||||
ANDA(operand);
|
||||
}
|
||||
|
||||
void EORA(uint8_t value) {
|
||||
adjustNZ(A() ^= value);
|
||||
}
|
||||
|
||||
void SRE(int bbb) {
|
||||
auto operand = AM_01(bbb);
|
||||
LSR(operand);
|
||||
setByte(operand);
|
||||
EORA(operand);
|
||||
}
|
||||
|
||||
void ROR(uint8_t& output);
|
||||
|
||||
void LSR(uint8_t& output);
|
||||
|
@ -395,6 +395,9 @@ std::string EightBit::Disassembly::disassemble(uint16_t current) const {
|
||||
case 0b001:
|
||||
output << disassemble_AM_01(bbb, "*RLA");
|
||||
break;
|
||||
case 0b010:
|
||||
output << disassemble_AM_01(bbb, "*SRE");
|
||||
break;
|
||||
case 0b100:
|
||||
output << disassemble_AM_11(bbb, "*SAX");
|
||||
break;
|
||||
|
@ -9,8 +9,8 @@ EightBit::MOS6502::MOS6502(Bus& bus)
|
||||
/* 1 */ 2, 5, 0, 7, 4, 4, 6, 6, 2, 4, 2, 6, 4, 4, 7, 6,
|
||||
/* 2 */ 6, 6, 0, 8, 3, 3, 5, 5, 4, 2, 2, 0, 4, 4, 6, 6,
|
||||
/* 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,
|
||||
/* 5 */ 2, 5, 0, 0, 4, 4, 6, 0, 2, 4, 2, 0, 4, 4, 7, 0,
|
||||
/* 4 */ 6, 6, 0, 8, 3, 3, 5, 5, 3, 2, 2, 0, 3, 4, 6, 6,
|
||||
/* 5 */ 2, 5, 0, 7, 4, 4, 6, 6, 2, 4, 2, 6, 4, 4, 7, 6,
|
||||
/* 6 */ 6, 6, 0, 0, 3, 3, 5, 0, 4, 2, 2, 0, 5, 4, 6, 0,
|
||||
/* 7 */ 2, 5, 0, 0, 4, 4, 6, 0, 2, 4, 2, 0, 4, 4, 7, 0,
|
||||
/* 8 */ 2, 6, 0, 6, 3, 3, 3, 3, 2, 0, 2, 0, 4, 4, 4, 4,
|
||||
@ -300,7 +300,7 @@ int EightBit::MOS6502::execute(uint8_t cell) {
|
||||
ANDA(AM_01(decoded.bbb));
|
||||
break;
|
||||
case 0b010: // EOR
|
||||
adjustNZ(A() ^= AM_01(decoded.bbb));
|
||||
EORA(AM_01(decoded.bbb));
|
||||
break;
|
||||
case 0b011: // ADC
|
||||
A() = ADC(A(), AM_01(decoded.bbb));
|
||||
@ -417,6 +417,9 @@ int EightBit::MOS6502::execute(uint8_t cell) {
|
||||
case 0b001: // *RLA
|
||||
RLA(decoded.bbb);
|
||||
break;
|
||||
case 0b010: // *SRE
|
||||
SRE(decoded.bbb);
|
||||
break;
|
||||
case 0b100: // *SAX
|
||||
AM_11(decoded.bbb, A() & X());
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user