CLR/CLRB fix (2)

This commit is contained in:
folkert van heusden 2023-03-18 23:34:41 +01:00
parent b035260e07
commit 3ede69e864
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1
2 changed files with 3 additions and 10 deletions

View file

@ -273,11 +273,6 @@ uint16_t bus::read(const uint16_t a, const bool word_mode, const bool use_prev,
DOLOG(debug, true, "bus::readWord: odd address UNHANDLED %o", a); DOLOG(debug, true, "bus::readWord: odd address UNHANDLED %o", a);
DOLOG(debug, true, "UNHANDLED read %o(%c)", a, word_mode ? 'B' : ' '); DOLOG(debug, true, "UNHANDLED read %o(%c)", a, word_mode ? 'B' : ' ');
// DEBUG CODE TODO
extern FILE *lfh;
fflush(lfh);
assert(false);
} }
return -1; return -1;

View file

@ -776,12 +776,10 @@ bool cpu::single_operand_instructions(const uint16_t instr)
// CLRB only clears the least significant byte // CLRB only clears the least significant byte
if (word_mode) { if (word_mode) {
if (dst_mode) if (dst_mode == 0)
r = b->read(g_dst.addr.value(), false, false) & 0xff00;
else
r = getRegister(dst_reg, false, false) & 0xff00; r = getRegister(dst_reg, false, false) & 0xff00;
// both in byte and word mode the full register must be updated // both in byte and word mode the full word must be updated
g_dst.word_mode = false; g_dst.word_mode = false;
} }
@ -1498,7 +1496,7 @@ bool cpu::misc_operations(const uint16_t instr)
return true; return true;
case 0b0000000000000100: // IOT case 0b0000000000000100: // IOT
trap(020); //trap(020); disabled for debugging
return true; return true;
case 0b0000000000000110: // RTT case 0b0000000000000110: // RTT