diff --git a/bus.cpp b/bus.cpp index 8c7e663..73c3370 100644 --- a/bus.cpp +++ b/bus.cpp @@ -246,20 +246,16 @@ uint16_t bus::read(const uint16_t a, const bool word_mode, const bool use_prev) const uint8_t apf = a >> 13; // active page field bool is_user = use_prev ? (c -> getBitPSW(12) && c -> getBitPSW(13)) : (c -> getBitPSW(14) && c -> getBitPSW(15)); - D(fprintf(stderr, "READ: is_user %d, offset %d\n", is_user, apf + is_user * 8);) uint32_t m_offset = pages[apf + is_user * 8].par * 64; if ((a & 1) && word_mode == 0) D(fprintf(stderr, "odd addressing\n");) - D(fprintf(stderr, "READ FROM %o\n", m_offset);) if (!word_mode) temp = m -> readWord(m_offset + (a & 8191)); else temp = m -> readByte(m_offset + (a & 8191)); - // D(fprintf(stderr, "read bus %o(%d): %o\n", a, word_mode, temp);) - return temp; } @@ -444,7 +440,6 @@ uint16_t bus::write(const uint16_t a, const bool word_mode, uint16_t value, cons const uint8_t apf = a >> 13; // active page field bool is_user = use_prev ? (c -> getBitPSW(12) && c -> getBitPSW(13)) : (c -> getBitPSW(14) && c -> getBitPSW(15)); - D(fprintf(stderr, "WRITE: is_user %d, offset %d\n", is_user, apf + is_user * 8);) uint32_t m_offset = pages[apf + is_user * 8].par * 64; pages[apf].pdr |= 1 << 6; // page has been written to @@ -452,7 +447,6 @@ uint16_t bus::write(const uint16_t a, const bool word_mode, uint16_t value, cons if ((a & 1) && word_mode == 0) D(fprintf(stderr, "odd addressing\n");) - D(fprintf(stderr, "WRITE TO: %o\n", m_offset);) if (word_mode) m -> writeByte(m_offset + (a & 8191), value); else diff --git a/cpu.cpp b/cpu.cpp index 5499169..08bb7f0 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -1160,13 +1160,13 @@ std::string cpu::addressing_to_string(const uint8_t mode_register, const uint16_ case 6: if (reg == 7) - return format("%06o", (pc + next_word) & 65535); + return format("%06o", next_word); return format("o%o(%s)", next_word, reg_name.c_str()); case 7: if (reg == 7) - return format("@%06o", (pc + next_word) & 65535); + return format("@%06o", next_word); return format("@o%o(%s)", next_word, reg_name.c_str()); } @@ -1410,7 +1410,7 @@ void cpu::disassemble() } if (text.empty() && name.empty() == false) - text = name + " $o" + format("%06o", new_pc); + text = name + " " + format("%06o", new_pc); } if (text.empty()) { @@ -1418,16 +1418,16 @@ void cpu::disassemble() text = format("SPL%d", instruction & 7); if ((instruction & ~31) == 0b10100000) { // set condition bits - text = word_mode ? "S" : "C"; + text = word_mode ? "S" : "CL"; if (instruction & 0b1000) - text += "n"; + text += "N"; if (instruction & 0b0100) - text += "z"; + text += "Z"; if (instruction & 0b0010) - text += "v"; + text += "V"; if (instruction & 0b0001) - text += "c"; + text += "C"; } switch(instruction) {