From d4de41da0bd70a51aeb26b3d1a8d70bd59b3447e Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sat, 15 Oct 2022 14:30:18 -0700 Subject: Add MQ register support. --- 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 1d46375..1979982 100644 --- a/isa/decode.cpp +++ b/isa/decode.cpp @@ -155,6 +155,25 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit if (skip) ctx.next_pc = (ctx.next_pc & 070000) | ((ctx.next_pc + 1) & 007777); }; + } else if ((bits & 0401) == 0401) { + bool cla = bits & 0200; + bool mqa = bits & 0100; + bool mql = bits & 0020; + bool extended_arith = bits & 0056; + inst.need_read_acc = mqa || mql; + inst.need_read_mq = mqa; + inst.need_write_acc = cla || mqa; + inst.need_write_mq = mql; + inst.ef = [cla, mqa, mql, extended_arith](auto &ctx) { + assert(!extended_arith); + if (cla) ctx.acc = 0; + auto new_acc = ctx.acc; + auto new_mq = ctx.mq; + if (mqa) new_acc = ctx.acc.value() | ctx.mq.value(); + if (mql) new_mq = ctx.acc.value(); + ctx.acc = new_acc; + ctx.mq = new_mq; + }; } else { assert(false); } -- cgit v1.2.3