diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-03 11:52:53 +0100 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-03 11:52:53 +0100 |
commit | 55e1bc746a45118e14554c957b4ee4663039d9af (patch) | |
tree | af416cb8dd60f47f47b6d9b943a53fe069543cdb /qtmips_machine/instruction.cpp | |
parent | 53c75d278a958e40b9c0b0ca3b04cfb11f356827 (diff) | |
download | qtmips-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.cpp | 7 |
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()); } |