1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-11-03 09:16:11 +00:00

Fix LINK A7.

This commit is contained in:
Thomas Harte
2022-05-07 08:15:26 -04:00
parent 1defeca1ad
commit 2b3900fd14
5 changed files with 9 additions and 7 deletions

View File

@@ -381,10 +381,12 @@ void Executor<model, BusHandler>::jsr(uint32_t address) {
}
template <Model model, typename BusHandler>
void Executor<model, BusHandler>::link(uint32_t &address, uint32_t offset) {
void Executor<model, BusHandler>::link(Preinstruction instruction, uint32_t offset) {
const auto reg = 8 + instruction.reg<0>();
sp().l -= 4;
bus_handler_.template write<uint32_t>(sp().l, address);
address = sp().l;
bus_handler_.template write<uint32_t>(sp().l, registers_[reg].l);
registers_[reg] = sp();
sp().l += offset;
}