From 9f4aa97822adc791f700670ef0fc7636849563b7 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sat, 29 Oct 2022 18:18:26 -0700 Subject: Understanding interrupt handling within SIMH (see echo_int.pal) Add list of Bugs Add event log file parser More changes associated with widening the ctlregs (FIXME add a typedef) Add some keyboard instructions --- isa/decode.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'isa/decode.cpp') diff --git a/isa/decode.cpp b/isa/decode.cpp index 9563327..c35118b 100644 --- a/isa/decode.cpp +++ b/isa/decode.cpp @@ -152,6 +152,24 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit ctx.next_pc = (ctx.next_pc & ~07777) | ((ctx.next_pc + 1) & 07777); }; break; + case 5: + // KIE set TT_INPUT_INT_ENABLE to the low bit of the accumulator + inst.need_read_acc = true; + inst.write_ctlreg = TT_INPUT_INT_ENABLE; + inst.ef = [](auto &ctx) { + ctx.ctlval = ctx.acc.value() & 3; + }; + break; + case 6: + // KRB transfer keyboard buffer to accumulator and clear TTI flag + inst.read_ctlreg = TT_BITS; + inst.need_write_acc = true; + inst.write_ctlreg = TT_BITS; + inst.ef = [](auto &ctx) { + ctx.acc = (ctx.ctlval.value() & TTI_DATA) >> TTI_DATA_SHIFT; + ctx.ctlval.value() &= ~TTI_FLAG; + }; + break; default: inst.ef = [bits](auto &ctx) { std::cerr << "unimplemented IOT KB suboperation " << (bits & 07) << "\n"; @@ -194,7 +212,7 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit inst.write_ctlreg = TT_BITS; inst.ef = [](auto &ctx) { auto &x = ctx.ctlval.value(); - auto chr = ctx.acc.value() ^ 0x80; + auto chr = ctx.acc.value(); x &= ~TTO_DATA; x |= (chr << TTO_DATA_SHIFT) & TTO_DATA; x |= TTO_TX; @@ -216,7 +234,7 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit inst.write_ctlreg = TT_BITS; inst.ef = [](auto &ctx) { auto &x = ctx.ctlval.value(); - auto chr = ctx.acc.value() ^ 0x80; + auto chr = ctx.acc.value(); x &= ~TTO_FLAG & ~TTO_FLAG_OLD & ~TTO_DATA; x |= (chr << TTO_DATA_SHIFT) & TTO_DATA; x |= TTO_TX; -- cgit v1.2.3