From 4f02e8fbaff2ab007cb27446be3005be002c9d94 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 20 Jan 2021 20:41:35 -0500 Subject: [PATCH] Knocks off the low-hanging instruction fruit. --- InstructionSets/M50740/Executor.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/InstructionSets/M50740/Executor.cpp b/InstructionSets/M50740/Executor.cpp index b071013ed..e6570dcb4 100644 --- a/InstructionSets/M50740/Executor.cpp +++ b/InstructionSets/M50740/Executor.cpp @@ -314,14 +314,24 @@ template void Executor::perform(uint8_t *operand [[maybe_u // after exiting from here. } break; - case Operation::ORA: set_nz(a_ |= *operand); break; - case Operation::AND: set_nz(a_ &= *operand); break; - case Operation::EOR: set_nz(a_ ^= *operand); break; + case Operation::ORA: set_nz(a_ |= *operand); break; + case Operation::AND: set_nz(a_ &= *operand); break; + case Operation::EOR: set_nz(a_ ^= *operand); break; + case Operation::COM: set_nz(*operand ^= 0xff); break; + + case Operation::FST: case Operation::SLW: case Operation::NOP: + // TODO: communicate FST and SLW onwards, I imagine. Find out what they interface with. + break; + + case Operation::PHA: push(a_); break; + case Operation::PHP: push(flags()); break; + case Operation::PLA: set_nz(a_ = pull()); break; + case Operation::PLP: set_flags(pull()); break; // TODO: // - // BRK, FST, SLW, NOP, PHA, PHP, PLA, PLP, STP, - // ADC, SBC, BIT, CMP, CPX, CPY, ASL, LSR, COM, ROL, ROR, RRF + // BRK, STP, + // ADC, SBC, BIT, CMP, CPX, CPY, ASL, LSR, ROL, ROR, RRF /* Operations affected by the index mode flag: ADC, AND, CMP, EOR, LDA, ORA, and SBC.