aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/instruction.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-03 11:52:53 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-03 11:52:53 +0100
commit55e1bc746a45118e14554c957b4ee4663039d9af (patch)
treeaf416cb8dd60f47f47b6d9b943a53fe069543cdb /qtmips_machine/instruction.cpp
parent53c75d278a958e40b9c0b0ca3b04cfb11f356827 (diff)
downloadqtmips-55e1bc746a45118e14554c957b4ee4663039d9af.tar.gz
qtmips-55e1bc746a45118e14554c957b4ee4663039d9af.tar.bz2
qtmips-55e1bc746a45118e14554c957b4ee4663039d9af.zip
Implement BREAK instruction to stop continuous execution.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/instruction.cpp')
-rw-r--r--qtmips_machine/instruction.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qtmips_machine/instruction.cpp b/qtmips_machine/instruction.cpp
index 7feebd3..0ca7b24 100644
--- a/qtmips_machine/instruction.cpp
+++ b/qtmips_machine/instruction.cpp
@@ -1,4 +1,5 @@
#include "instruction.h"
+#include "alu.h"
#include "qtmipsexception.h"
using namespace machine;
@@ -108,7 +109,7 @@ static const struct AluInstructionMap alu_instruction_map[] = {
{"MOVZ"},
{"MOVN"},
AIM_UNKNOWN,
- AIM_UNKNOWN,
+ {"BREAK"},
AIM_UNKNOWN,
AIM_UNKNOWN,
{"MFHI"},
@@ -231,6 +232,10 @@ bool Instruction::is_store() const {
return im.is_store;
}
+bool Instruction::is_break() const {
+ return opcode() == 0 && funct() == ALU_OP_BREAK;
+}
+
bool Instruction::operator==(const Instruction &c) const {
return (this->data() == c.data());
}