mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-31 17:33:07 +00:00
Implementing MVN
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// Created by anonymus-raccoon on 2/28/20.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include "../CPU.hpp"
|
||||
|
||||
namespace ComSquare::CPU
|
||||
@@ -150,4 +151,21 @@ namespace ComSquare::CPU
|
||||
this->_registers.p.z = this->_registers.y == 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CPU::MVN(uint24_t params, AddressingMode)
|
||||
{
|
||||
uint8_t srcBank = params;
|
||||
uint8_t destBank = params >> 8u;
|
||||
int length = this->_registers.a + 1;
|
||||
|
||||
this->_registers.dbr = destBank;
|
||||
while (this->_registers.a != 0xFFFF) {
|
||||
uint8_t data = this->_bus->read(srcBank << 24u | this->_registers.x);
|
||||
this->_bus->write(destBank << 24u | this->_registers.y, data);
|
||||
this->_registers.x++;
|
||||
this->_registers.y++;
|
||||
this->_registers.a--;
|
||||
}
|
||||
return 7 * length;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user