MFPI/MTPI require special handling for SP
This commit is contained in:
parent
be4fbdc4ec
commit
ee8d772426
1 changed files with 25 additions and 8 deletions
33
cpu.cpp
33
cpu.cpp
|
@ -1275,12 +1275,20 @@ bool cpu::single_operand_instructions(const uint16_t instr)
|
||||||
if ((b->getMMR1() & 0160000) == 0)
|
if ((b->getMMR1() & 0160000) == 0)
|
||||||
b->addToMMR1(-2, 6);
|
b->addToMMR1(-2, 6);
|
||||||
|
|
||||||
// calculate address in current address space
|
bool set_flags = true;
|
||||||
uint16_t a = getGAMAddress(dst_mode, dst_reg, false, false);
|
uint16_t v = 0xffff;
|
||||||
// reed from previous space
|
|
||||||
uint16_t v = b -> read(a, false, true);
|
|
||||||
|
|
||||||
bool set_flags = a != 0177776;
|
if (dst_mode == 0)
|
||||||
|
v = getRegister(dst_reg, true);
|
||||||
|
else {
|
||||||
|
// calculate address in current address space
|
||||||
|
uint16_t a = getGAMAddress(dst_mode, dst_reg, false, false);
|
||||||
|
|
||||||
|
set_flags = a != 0177776;
|
||||||
|
|
||||||
|
// read from previous space
|
||||||
|
v = b -> read(a, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (set_flags) {
|
if (set_flags) {
|
||||||
setPSW_n(SIGN(v, false));
|
setPSW_n(SIGN(v, false));
|
||||||
|
@ -1304,9 +1312,17 @@ bool cpu::single_operand_instructions(const uint16_t instr)
|
||||||
// retrieve word from '15/14'-stack
|
// retrieve word from '15/14'-stack
|
||||||
uint16_t v = popStack();
|
uint16_t v = popStack();
|
||||||
|
|
||||||
uint16_t a = getGAMAddress(dst_mode, dst_reg, false, false);
|
uint16_t a = 0xffff;
|
||||||
|
|
||||||
bool set_flags = a != 0177776;
|
bool set_flags = true;
|
||||||
|
|
||||||
|
if (dst_mode == 0)
|
||||||
|
setRegister(dst_reg, true, v);
|
||||||
|
else {
|
||||||
|
a = getGAMAddress(dst_mode, dst_reg, false, false);
|
||||||
|
|
||||||
|
set_flags = a != 0177776;
|
||||||
|
}
|
||||||
|
|
||||||
if (set_flags) {
|
if (set_flags) {
|
||||||
setPSW_n(SIGN(v, false));
|
setPSW_n(SIGN(v, false));
|
||||||
|
@ -1314,7 +1330,8 @@ bool cpu::single_operand_instructions(const uint16_t instr)
|
||||||
setPSW_v(false);
|
setPSW_v(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
b -> write(a, false, v, true); // put in '13/12' address space
|
if (dst_mode != 0)
|
||||||
|
b -> write(a, false, v, true); // put in '13/12' address space
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue