use from previous-addresspace was not implemented
This commit is contained in:
parent
42c065056c
commit
04eb498f88
2 changed files with 17 additions and 9 deletions
4
bus.cpp
4
bus.cpp
|
@ -297,6 +297,8 @@ uint16_t bus::read(const uint16_t a, const bool word_mode, const bool use_prev)
|
||||||
|
|
||||||
if (a < 01000)
|
if (a < 01000)
|
||||||
run_mode = 0;
|
run_mode = 0;
|
||||||
|
else if (use_prev)
|
||||||
|
run_mode = (c->getPSW() >> 12) & 3;
|
||||||
|
|
||||||
uint32_t m_offset = pages[run_mode][apf].par * 64;
|
uint32_t m_offset = pages[run_mode][apf].par * 64;
|
||||||
|
|
||||||
|
@ -556,6 +558,8 @@ uint16_t bus::write(const uint16_t a, const bool word_mode, uint16_t value, cons
|
||||||
|
|
||||||
if (a < 01000)
|
if (a < 01000)
|
||||||
run_mode = 0;
|
run_mode = 0;
|
||||||
|
else if (use_prev)
|
||||||
|
run_mode = (c->getPSW() >> 12) & 3;
|
||||||
|
|
||||||
uint32_t m_offset = pages[run_mode][apf].par * 64;
|
uint32_t m_offset = pages[run_mode][apf].par * 64;
|
||||||
|
|
||||||
|
|
22
cpu.cpp
22
cpu.cpp
|
@ -857,20 +857,22 @@ bool cpu::single_operand_instructions(const uint16_t instr)
|
||||||
}
|
}
|
||||||
|
|
||||||
case 0b00110101: { // MFPD/MFPI
|
case 0b00110101: { // MFPD/MFPI
|
||||||
// FIXME
|
// for MFPD versus MFPI
|
||||||
uint16_t v = getGAM(dst_mode, dst_reg, word_mode, true);
|
uint16_t a = getGAMAddress(dst_mode, dst_reg, false, false);
|
||||||
|
uint16_t v = b -> read(a, false, true);
|
||||||
|
|
||||||
setPSW_n(word_mode ? v & 0x80 : v & 0x8000);
|
setPSW_n(word_mode ? v & 0x80 : v & 0x8000);
|
||||||
setPSW_z(v == 0);
|
setPSW_z(v == 0);
|
||||||
setPSW_v(false);
|
setPSW_v(false);
|
||||||
|
|
||||||
pushStack(v);
|
pushStack(v);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 0b00110110: { // MTPI/MTPD
|
case 0b00110110: { // MTPI/MTPD
|
||||||
// always words: word_mode-bit is to select between MTPI and MTPD
|
// always words: word_mode-bit is to select between MTPI and MTPD
|
||||||
|
|
||||||
// calculate address in '13/12'-address-space
|
|
||||||
uint16_t a = getGAMAddress(dst_mode, dst_reg, false, true);
|
|
||||||
// retrieve word from '15/14'-stack
|
// retrieve word from '15/14'-stack
|
||||||
uint16_t v = popStack();
|
uint16_t v = popStack();
|
||||||
|
|
||||||
|
@ -878,12 +880,14 @@ bool cpu::single_operand_instructions(const uint16_t instr)
|
||||||
setPSW_z(v == 0);
|
setPSW_z(v == 0);
|
||||||
setPSW_v(false);
|
setPSW_v(false);
|
||||||
|
|
||||||
D(fprintf(stderr, "MTP%c: address %06o, value %06o\n", word_mode ? 'D' : 'I', a, v);)
|
|
||||||
|
|
||||||
if (dst_mode == 0)
|
if (dst_mode == 0)
|
||||||
putGAM(dst_mode, dst_reg, false, v, false); // ???
|
putGAM(dst_mode, dst_reg, false, v, true);
|
||||||
else
|
else {
|
||||||
b -> write(a, false, v);
|
uint16_t a = getGAMAddress(dst_mode, dst_reg, false, false);
|
||||||
|
|
||||||
|
// put in '13/12' address space
|
||||||
|
b -> write(a, false, v, true);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue