From e1b4028d0feb045abf4dd413d5e3bb80269c84b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 15 Jan 2018 13:14:40 +0100 Subject: Reverse translate NOP correctly --- qtmips_machine/instruction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qtmips_machine/instruction.cpp') diff --git a/qtmips_machine/instruction.cpp b/qtmips_machine/instruction.cpp index 4ef65a4..7ff35fe 100644 --- a/qtmips_machine/instruction.cpp +++ b/qtmips_machine/instruction.cpp @@ -229,9 +229,11 @@ static const struct AluInstructionMap alu_instruction_map[] = { #undef AIM_UNKNOWN QString Instruction::to_str() const { - // TODO there are exception where some fields are zero and such so we should not print them in sych case + // TODO there are exception where some fields are zero and such so we should not print them in such case if (opcode() >= (sizeof(instruction_map) / sizeof(struct InstructionMap))) return QString("UNKNOWN"); + if (dt == 0) + return QString("NOP"); const struct InstructionMap &im = instruction_map[opcode()]; QString res; switch (im.type) { -- cgit v1.2.3