aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/instruction.cpp
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-15 13:14:40 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-15 13:14:40 +0100
commite1b4028d0feb045abf4dd413d5e3bb80269c84b7 (patch)
treed06cc30b220983590914026b3a56c52ed6b446d9 /qtmips_machine/instruction.cpp
parent5241e1d9733ea69a91d3f497bc794ce881ad49fd (diff)
downloadqtmips-e1b4028d0feb045abf4dd413d5e3bb80269c84b7.tar.gz
qtmips-e1b4028d0feb045abf4dd413d5e3bb80269c84b7.tar.bz2
qtmips-e1b4028d0feb045abf4dd413d5e3bb80269c84b7.zip
Reverse translate NOP correctly
Diffstat (limited to 'qtmips_machine/instruction.cpp')
-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) {