From cec760767aa5d71f86ffb9bc4c081b5b626262cc Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Tue, 20 Nov 2018 08:51:17 +0000 Subject: [PATCH] Fix some problems in the MC6809 instruction decoder. Found by going through the switch line by line... BASIC interpreter now seems to run! Signed-off-by: Adrian Conlon --- MC6809/src/mc6809.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MC6809/src/mc6809.cpp b/MC6809/src/mc6809.cpp index 610d5c5..7d35b3f 100644 --- a/MC6809/src/mc6809.cpp +++ b/MC6809/src/mc6809.cpp @@ -331,10 +331,10 @@ void EightBit::mc6809::executeUnprefixed(const uint8_t opcode) { case 0xba: addCycles(5); A() = orr(A(), AM_extended_byte()); break; // OR (ORA extended) // ORB - case 0xca: addCycles(2); A() = orr(A(), AM_immediate_byte()); break; // OR (ORB immediate) - case 0xda: addCycles(4); A() = orr(A(), AM_direct_byte()); break; // OR (ORB direct) - case 0xea: addCycles(4); A() = orr(A(), AM_indexed_byte()); break; // OR (ORB indexed) - case 0xfa: addCycles(5); A() = orr(A(), AM_extended_byte()); break; // OR (ORB extended) + case 0xca: addCycles(2); B() = orr(B(), AM_immediate_byte()); break; // OR (ORB immediate) + case 0xda: addCycles(4); B() = orr(B(), AM_direct_byte()); break; // OR (ORB direct) + case 0xea: addCycles(4); B() = orr(B(), AM_indexed_byte()); break; // OR (ORB indexed) + case 0xfa: addCycles(5); B() = orr(B(), AM_extended_byte()); break; // OR (ORB extended) // ORCC case 0x1a: addCycles(3); CC() |= AM_immediate_byte(); break; // OR (ORCC immediate) @@ -534,7 +534,7 @@ void EightBit::mc6809::execute10(const uint8_t opcode) { case 0xff: addCycles(7); Processor::setWord(Address_extended(), st(S())); break; // ST (STS extended) // STY - case 0x9f: addCycles(6); Processor::setWord(Address_extended(), st(Y())); break; // ST (STY direct) + case 0x9f: addCycles(6); Processor::setWord(Address_direct(), st(Y())); break; // ST (STY direct) case 0xaf: addCycles(6); Processor::setWord(Address_indexed(), st(Y())); break; // ST (STY indexed) case 0xbf: addCycles(7); Processor::setWord(Address_extended(), st(Y())); break; // ST (STY extended)