diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-07-02 12:22:05 +0200 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-07-02 12:22:05 +0200 |
commit | cf97513e757cdd25e6b1dd1fd584e4ec13d93cb1 (patch) | |
tree | 2fa12b7e17d460e3b9f39f024fcab863653b6823 /qtmips_machine/instruction.h | |
parent | b62686b24fbb65d0810475e24aba7a5c4ee3e05e (diff) | |
download | qtmips-cf97513e757cdd25e6b1dd1fd584e4ec13d93cb1.tar.gz qtmips-cf97513e757cdd25e6b1dd1fd584e4ec13d93cb1.tar.bz2 qtmips-cf97513e757cdd25e6b1dd1fd584e4ec13d93cb1.zip |
Evaluation of symbolic expressions in assembler added.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/instruction.h')
-rw-r--r-- | qtmips_machine/instruction.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qtmips_machine/instruction.h b/qtmips_machine/instruction.h index f721835..d55b079 100644 --- a/qtmips_machine/instruction.h +++ b/qtmips_machine/instruction.h @@ -77,7 +77,7 @@ enum InstructionFlags { 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) { + std::int64_t max, unsigned lsb_bit, unsigned bits, unsigned shift, int line) { this->location = location; this->expression = expression; this->offset = offset; @@ -86,6 +86,7 @@ struct RelocExpression { this->lsb_bit = lsb_bit; this->bits = bits; this->shift = shift; + this->line = line; } std::int32_t location; QString expression; @@ -95,6 +96,7 @@ struct RelocExpression { unsigned lsb_bit; unsigned bits; unsigned shift; + int line; }; typedef QVector<RelocExpression *> RelocExpressionList; @@ -143,7 +145,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, RelocExpressionList *reloc = nullptr); + std::uint32_t inst_addr = 0, RelocExpressionList *reloc = nullptr, int line = 0); + bool update(std::int64_t val, RelocExpression *relocexp); private: std::uint32_t dt; }; |