From 76a6dbe75eeedad06271df2b207f977f08dfc84b Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sun, 23 Oct 2022 13:03:07 -0700 Subject: Improve error messages for unimplemented instructions --- isa/decode.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'isa/decode.cpp') diff --git a/isa/decode.cpp b/isa/decode.cpp index d709cf8..4af9a0d 100644 --- a/isa/decode.cpp +++ b/isa/decode.cpp @@ -1,4 +1,5 @@ #include +#include #include "isa/isa.h" @@ -112,31 +113,31 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit case 4: // GTF get flags inst.ef = [](auto &ctx) { + std::cerr << "unimplemented GTF\n"; assert(false); }; break; case 5: // RTF restore flags inst.ef = [](auto &ctx) { + std::cerr << "unimplemented RTF\n"; assert(false); }; break; case 6: // SGT skip if greater than inst.ef = [](auto &ctx) { + std::cerr << "unimplemented SGT\n"; assert(false); }; break; case 7: // CAF clear all flags inst.ef = [](auto &ctx) { + std::cerr << "unimplemented CAF\n"; assert(false); }; break; - default: - inst.ef = [](auto &ctx) { - assert(false); - }; } break; case 004: @@ -203,13 +204,15 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit }; break; default: - inst.ef = [](auto &ctx) { + inst.ef = [bits](auto &ctx) { + std::cerr << "unimplemented IOT TT suboperation " << (bits & 07) << "\n"; assert(false); }; } break; default: - inst.ef = [](auto &ctx) { + inst.ef = [bits](auto &ctx) { + std::cerr << "unimplemented IOT device " << ((bits >> 6) & 07) << ((bits >> 3) & 07) << " suboperation " << (bits & 07) << "\n"; assert(false); }; } @@ -323,7 +326,10 @@ instruction_context decode(unsigned int dfifb, unsigned int pc, unsigned int bit ctx.mq = new_mq; }; } else { - assert(false); + inst.ef = [bits](auto &ctx) { + std::cerr << "unimplemented OPR " << ((bits >> 6) & 07) << ((bits >> 3) & 07) << (bits & 07) << "\n"; + assert(false); + }; } break; } -- cgit v1.2.3