SOB fix
This commit is contained in:
parent
0d16d16ab8
commit
c225b01d71
1 changed files with 8 additions and 2 deletions
10
cpu.cpp
10
cpu.cpp
|
@ -529,12 +529,18 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
|
||||||
}
|
}
|
||||||
|
|
||||||
case 7: { // SOB
|
case 7: { // SOB
|
||||||
uint16_t oldPC = getPC(); // FIXME gaat dit wel goed voor R7?
|
uint16_t oldPC = getPC();
|
||||||
addRegister(reg, false, -1);
|
|
||||||
|
if (reg == 7)
|
||||||
|
addRegister(reg, false, -2);
|
||||||
|
else
|
||||||
|
addRegister(reg, false, -1);
|
||||||
|
|
||||||
if (getRegister(reg, false)) {
|
if (getRegister(reg, false)) {
|
||||||
uint16_t newPC = oldPC - dst * 2;
|
uint16_t newPC = oldPC - dst * 2;
|
||||||
setPC(newPC);
|
setPC(newPC);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue