mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-07-19 02:25:24 +00:00
More memptr adjustments
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
@@ -21,14 +21,14 @@ uint8_t EightBit::IntelProcessor::pop() {
|
||||
}
|
||||
|
||||
EightBit::register16_t EightBit::IntelProcessor::getWord() {
|
||||
BUS().ADDRESS() = MEMPTR()++;
|
||||
const auto low = BUS().read();
|
||||
++BUS().ADDRESS();
|
||||
MEMPTR() = ++BUS().ADDRESS();
|
||||
const auto high = BUS().read();
|
||||
return register16_t(low, high);
|
||||
}
|
||||
|
||||
void EightBit::IntelProcessor::setWord(const register16_t value) {
|
||||
BUS().write(MEMPTR()++, value.low);
|
||||
BUS().write(++BUS().ADDRESS(), value.high);
|
||||
BUS().write(value.low);
|
||||
MEMPTR() = ++BUS().ADDRESS();
|
||||
BUS().write(value.high);
|
||||
}
|
||||
|
Reference in New Issue
Block a user