aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/instruction.cpp
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-11-21 19:48:51 +0100
committerKarel Kočí <cynerd@email.cz>2017-11-21 19:48:51 +0100
commit499a88621d12ff0cdcba1f8c796b7031d6adc649 (patch)
treec050b5224c896b3e14d74866473aef9c2a5e9b69 /qtmips_machine/instruction.cpp
parent68f2af6801756980ec53347c0acb7fcc292f7939 (diff)
downloadqtmips-499a88621d12ff0cdcba1f8c796b7031d6adc649.tar.gz
qtmips-499a88621d12ff0cdcba1f8c796b7031d6adc649.tar.bz2
qtmips-499a88621d12ff0cdcba1f8c796b7031d6adc649.zip
Add possibility to compare memory and registers state
For core testing we want to compare whole memory and registers. Registers are pretty simple but in case of memory it is some what more complicated and required its own tests to be sure that it works.
Diffstat (limited to 'qtmips_machine/instruction.cpp')
-rw-r--r--qtmips_machine/instruction.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/qtmips_machine/instruction.cpp b/qtmips_machine/instruction.cpp
index 8591d93..91bd1c8 100644
--- a/qtmips_machine/instruction.cpp
+++ b/qtmips_machine/instruction.cpp
@@ -28,6 +28,10 @@ const struct InstructionMap instruction_map[] = {
IM_UNKNOWN
};
+Instruction::Instruction() {
+ this->dt = 0;
+}
+
Instruction::Instruction(std::uint32_t inst) {
this->dt = inst;
}
@@ -56,6 +60,10 @@ Instruction::Instruction(std::uint8_t opcode, std::uint32_t address) {
this->dt |= address;
}
+Instruction::Instruction(const Instruction &i) {
+ this->dt = i.data();
+}
+
QString Instruction::to_str() {
if (this->opcode() >= sizeof(instruction_map))
return QString("UNKNOWN");