From ff66523bb076a246c2fc159f0f76947bd6f84fc1 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sat, 29 Oct 2022 12:55:08 -0700 Subject: Control register values should not be "unsigned int" --- isa/decode.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'isa/decode.cpp') diff --git a/isa/decode.cpp b/isa/decode.cpp index 4af9a0d..9563327 100644 --- a/isa/decode.cpp +++ b/isa/decode.cpp @@ -140,6 +140,25 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit break; } break; + case 003: + // KEYBOARD + switch (bits & 07) { + case 1: + // KSF skip if TTI flag is set + inst.read_ctlreg = TT_BITS; + inst.possibly_redirects = true; + inst.ef = [](auto &ctx) { + if (ctx.ctlval.value() & TTI_FLAG) + ctx.next_pc = (ctx.next_pc & ~07777) | ((ctx.next_pc + 1) & 07777); + }; + break; + default: + inst.ef = [bits](auto &ctx) { + std::cerr << "unimplemented IOT KB suboperation " << (bits & 07) << "\n"; + assert(false); + }; + } + break; case 004: // TELETYPE TELEPRINTER/PUNCH switch (bits & 07) { -- cgit v1.2.3