aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine
diff options
context:
space:
mode:
Diffstat (limited to 'qtmips_machine')
-rw-r--r--qtmips_machine/instruction.cpp4
1 files changed, 3 insertions, 1 deletions
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) {