disas output tweaks

This commit is contained in:
folkert van heusden 2022-03-16 13:02:59 +01:00
parent 745657d76e
commit 9dc6172ba3
2 changed files with 8 additions and 14 deletions

View file

@ -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 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)); 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; uint32_t m_offset = pages[apf + is_user * 8].par * 64;
if ((a & 1) && word_mode == 0) if ((a & 1) && word_mode == 0)
D(fprintf(stderr, "odd addressing\n");) D(fprintf(stderr, "odd addressing\n");)
D(fprintf(stderr, "READ FROM %o\n", m_offset);)
if (!word_mode) if (!word_mode)
temp = m -> readWord(m_offset + (a & 8191)); temp = m -> readWord(m_offset + (a & 8191));
else else
temp = m -> readByte(m_offset + (a & 8191)); temp = m -> readByte(m_offset + (a & 8191));
// D(fprintf(stderr, "read bus %o(%d): %o\n", a, word_mode, temp);)
return 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 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)); 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; uint32_t m_offset = pages[apf + is_user * 8].par * 64;
pages[apf].pdr |= 1 << 6; // page has been written to 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) if ((a & 1) && word_mode == 0)
D(fprintf(stderr, "odd addressing\n");) D(fprintf(stderr, "odd addressing\n");)
D(fprintf(stderr, "WRITE TO: %o\n", m_offset);)
if (word_mode) if (word_mode)
m -> writeByte(m_offset + (a & 8191), value); m -> writeByte(m_offset + (a & 8191), value);
else else

16
cpu.cpp
View file

@ -1160,13 +1160,13 @@ std::string cpu::addressing_to_string(const uint8_t mode_register, const uint16_
case 6: case 6:
if (reg == 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()); return format("o%o(%s)", next_word, reg_name.c_str());
case 7: case 7:
if (reg == 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()); return format("@o%o(%s)", next_word, reg_name.c_str());
} }
@ -1410,7 +1410,7 @@ void cpu::disassemble()
} }
if (text.empty() && name.empty() == false) if (text.empty() && name.empty() == false)
text = name + " $o" + format("%06o", new_pc); text = name + " " + format("%06o", new_pc);
} }
if (text.empty()) { if (text.empty()) {
@ -1418,16 +1418,16 @@ void cpu::disassemble()
text = format("SPL%d", instruction & 7); text = format("SPL%d", instruction & 7);
if ((instruction & ~31) == 0b10100000) { // set condition bits if ((instruction & ~31) == 0b10100000) { // set condition bits
text = word_mode ? "S" : "C"; text = word_mode ? "S" : "CL";
if (instruction & 0b1000) if (instruction & 0b1000)
text += "n"; text += "N";
if (instruction & 0b0100) if (instruction & 0b0100)
text += "z"; text += "Z";
if (instruction & 0b0010) if (instruction & 0b0010)
text += "v"; text += "V";
if (instruction & 0b0001) if (instruction & 0b0001)
text += "c"; text += "C";
} }
switch(instruction) { switch(instruction) {