From da2682d49fc60e22bf8c3ea21947ace339967e68 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sat, 5 Nov 2022 12:53:07 -0700 Subject: Implement RMF instruction --- isa/decode.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/isa/decode.cpp b/isa/decode.cpp index 6ea3bb5..6ab90fd 100644 --- a/isa/decode.cpp +++ b/isa/decode.cpp @@ -6,13 +6,17 @@ instruction_context decode(std::uint_fast32_t flags, unsigned int pc, unsigned int bits, bool interrupt) { - //bool gt = (flags >> 10) & 1; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" + bool ied = (flags >> 12) & 1; + bool gt = (flags >> 10) & 1; bool ir = (flags >> 9) & 1; - //bool ii = (flags >> 8) & 1; + bool ii = (flags >> 8) & 1; bool ie = (flags >> 7) & 1; - //bool u = (flags >> 6) & 1; + bool u = (flags >> 6) & 1; bool ifb = (flags >> 3) & 7; bool df = flags & 7; +#pragma GCC diagnostic pop instruction_context inst; inst.next_pc = (pc & ~07777) | ((pc + 1) & 07777); @@ -283,6 +287,15 @@ instruction_context decode(std::uint_fast32_t flags, unsigned int pc, unsigned i ctx.ctlval = (flags & ~FLAG_DF) | (field << FLAG_DF_SHIFT); }; break; + case 04: + // RMF restore memory field + inst.read_ctlreg = FLAGS_SAVED; + inst.write_ctlreg = FLAGS; + inst.ef = [flags](auto &ctx) { + ctx.ctlval.value() &= FLAG_DF | FLAG_IF | FLAG_USER_MODE; + ctx.ctlval.value() |= flags & ~(FLAG_DF | FLAG_IF | FLAG_USER_MODE); + }; + break; default: inst.ef = [bits, field](auto &ctx) { std::cerr << "unimplemented IOT MEMORY suboperation " << (bits & 07) << " upon field " << field << "\n"; -- cgit v1.2.3