mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-07-22 22:24:11 +00:00
Start refactoring the processor classes to allow big/little endian processors to be specified.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "IntelProcessor.h"
|
||||
|
||||
EightBit::IntelProcessor::IntelProcessor(Bus& bus)
|
||||
: Processor(bus) {
|
||||
: LittleEndianProcessor(bus) {
|
||||
for (int i = 0; i < 0x100; ++i)
|
||||
m_decodedOpcodes[i] = i;
|
||||
}
|
||||
@@ -21,14 +21,12 @@ uint8_t EightBit::IntelProcessor::pop() {
|
||||
}
|
||||
|
||||
EightBit::register16_t EightBit::IntelProcessor::getWord() {
|
||||
const auto low = BUS().read();
|
||||
MEMPTR() = ++BUS().ADDRESS();
|
||||
const auto high = BUS().read();
|
||||
return register16_t(low, high);
|
||||
const auto returned = LittleEndianProcessor::getWord();
|
||||
MEMPTR() = BUS().ADDRESS();
|
||||
return returned;
|
||||
}
|
||||
|
||||
void EightBit::IntelProcessor::setWord(const register16_t value) {
|
||||
BUS().write(value.low);
|
||||
MEMPTR() = ++BUS().ADDRESS();
|
||||
BUS().write(value.high);
|
||||
LittleEndianProcessor::setWord(value);
|
||||
MEMPTR() = BUS().ADDRESS();
|
||||
}
|
||||
|
Reference in New Issue
Block a user