From a421ef693fd3b2d299856ab5b59cab4bc238ce7a Mon Sep 17 00:00:00 2001
From: Anonymus Raccoon
Date: Tue, 25 Feb 2020 23:32:19 +0100
Subject: [PATCH] Starting the SBC instruction
---
sources/CPU/CPU.hpp | 3 ++-
sources/CPU/Instructions/MathematicalOperations.cpp | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/sources/CPU/CPU.hpp b/sources/CPU/CPU.hpp
index ddd184a..23d1f83 100644
--- a/sources/CPU/CPU.hpp
+++ b/sources/CPU/CPU.hpp
@@ -393,7 +393,6 @@ namespace ComSquare::CPU
//! @brief Return from Interrupt - Used to return from a interrupt handler.
void RTI();
//! @brief Add with carry - Adds operand to the Accumulator; adds an additional 1 if carry is set.
- //! @return The number of extra cycles that this operation took.
void ADC(uint24_t valueAddr);
//! @brief Store the accumulator to memory.
void STA(uint24_t addr);
@@ -461,6 +460,8 @@ namespace ComSquare::CPU
void XCE();
//! @brief And accumulator with memory.
void AND(uint24_t valueAddr);
+ //! @brief Subtract with Borrow from Accumulator.
+ void SBC(uint24_t valueAddr);
public:
explicit CPU(std::shared_ptr bus, Cartridge::Header &cartridgeHeader);
CPU(const CPU &) = default;
diff --git a/sources/CPU/Instructions/MathematicalOperations.cpp b/sources/CPU/Instructions/MathematicalOperations.cpp
index 83455f8..8300f69 100644
--- a/sources/CPU/Instructions/MathematicalOperations.cpp
+++ b/sources/CPU/Instructions/MathematicalOperations.cpp
@@ -26,4 +26,9 @@ namespace ComSquare::CPU
this->_registers.p.z = this->_registers.a == 0;
this->_registers.p.n = this->_registers.a & negativeMask;
}
+
+ void CPU::SBC(uint24_t valueAddr)
+ {
+
+ }
}
\ No newline at end of file