aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/instruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'qtmips_machine/instruction.h')
-rw-r--r--qtmips_machine/instruction.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/qtmips_machine/instruction.h b/qtmips_machine/instruction.h
index f86d10c..f721835 100644
--- a/qtmips_machine/instruction.h
+++ b/qtmips_machine/instruction.h
@@ -38,6 +38,7 @@
#include <QObject>
#include <QString>
+#include <QVector>
#include "machinedefs.h"
@@ -74,6 +75,30 @@ enum InstructionFlags {
IMF_STOP_IF = 1L<<23, /**< Stop instruction fetch until instruction processed */
};
+struct RelocExpression {
+ inline RelocExpression(std::int32_t location, QString expression, std::int64_t offset, std::int64_t min,
+ std::int64_t max, unsigned lsb_bit, unsigned bits, unsigned shift) {
+ this->location = location;
+ this->expression = expression;
+ this->offset = offset;
+ this->min = min;
+ this->max = max;
+ this->lsb_bit = lsb_bit;
+ this->bits = bits;
+ this->shift = shift;
+ }
+ std::int32_t location;
+ QString expression;
+ std::int64_t offset;
+ std::int64_t min;
+ std::int64_t max;
+ unsigned lsb_bit;
+ unsigned bits;
+ unsigned shift;
+};
+
+typedef QVector<RelocExpression *> RelocExpressionList;
+
class Instruction {
public:
Instruction();
@@ -117,7 +142,8 @@ public:
QString to_str(std::int32_t inst_addr = 0) const;
- static Instruction from_string(QString str, bool *pok = nullptr, std::uint32_t inst_addr = 0);
+ static Instruction from_string(QString str, bool *pok = nullptr,
+ std::uint32_t inst_addr = 0, RelocExpressionList *reloc = nullptr);
private:
std::uint32_t dt;
};