aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-06 14:35:31 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-06 14:38:00 +0100
commitc27a1e6354c04904345855e1d28b0e711efa1575 (patch)
tree4acd3b4abc93bbe3ab582b0b66d9efdafa87360c
parente6eccde424e3162f6cb4df05e04fe228241a23f5 (diff)
downloadqtmips-c27a1e6354c04904345855e1d28b0e711efa1575.tar.gz
qtmips-c27a1e6354c04904345855e1d28b0e711efa1575.tar.bz2
qtmips-c27a1e6354c04904345855e1d28b0e711efa1575.zip
Correct registers order in conversion to text for branch instructions.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
-rw-r--r--qtmips_machine/instruction.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qtmips_machine/instruction.cpp b/qtmips_machine/instruction.cpp
index a0570fd..ed9064b 100644
--- a/qtmips_machine/instruction.cpp
+++ b/qtmips_machine/instruction.cpp
@@ -458,7 +458,7 @@ QString Instruction::to_str() const {
res += " $" + QString::number(rt());
res += ", 0x" + QString::number(immediate(), 16).toUpper() + "(" + QString::number(rs()) + ")";
} else {
- if (im.flags & (IMF_BJR_REQ_RT | IMF_ALU_REQ_RT | IMF_REGWRITE)) {
+ if (im.flags & IMF_REGWRITE) {
res += next_delim + "$" + QString::number(rt());
next_delim = ", ";
}
@@ -466,6 +466,10 @@ QString Instruction::to_str() const {
res += next_delim + "$" + QString::number(rs());
next_delim = ", ";
}
+ if (im.flags & (IMF_BJR_REQ_RT | IMF_ALU_REQ_RT) && !(im.flags & IMF_REGWRITE)) {
+ res += next_delim + "$" + QString::number(rt());
+ next_delim = ", ";
+ }
res += next_delim + "0x" + QString::number(immediate(), 16).toUpper();
}
break;