diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-06 14:35:31 +0100 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-06 14:38:00 +0100 |
commit | c27a1e6354c04904345855e1d28b0e711efa1575 (patch) | |
tree | 4acd3b4abc93bbe3ab582b0b66d9efdafa87360c /qtmips_machine | |
parent | e6eccde424e3162f6cb4df05e04fe228241a23f5 (diff) | |
download | qtmips-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>
Diffstat (limited to 'qtmips_machine')
-rw-r--r-- | qtmips_machine/instruction.cpp | 6 |
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; |