diff options
Diffstat (limited to 'qtmips_machine/instructions/arithmetic.h')
-rw-r--r-- | qtmips_machine/instructions/arithmetic.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/qtmips_machine/instructions/arithmetic.h b/qtmips_machine/instructions/arithmetic.h index 19f1df5..185ed95 100644 --- a/qtmips_machine/instructions/arithmetic.h +++ b/qtmips_machine/instructions/arithmetic.h @@ -19,9 +19,16 @@ enum InstructionArithmeticT { class InstructionArithmetic : public InstructionR { public: InstructionArithmetic(enum InstructionArithmeticT type, std::uint8_t rs, std::uint8_t rd, std::uint8_t rt); + + void decode(Registers *regs); + void execute(); + void memory(Memory *mem); + void write_back(Registers *regs); + QVector<QString> to_strs(); private: enum InstructionArithmeticT type; + std::uint32_t rs_d, rd_d, rt_d; }; enum InstructionArithmeticImmediateT { @@ -38,9 +45,16 @@ enum InstructionArithmeticImmediateT { class InstructionArithmeticImmediate : public InstructionI { public: InstructionArithmeticImmediate(enum InstructionArithmeticImmediateT type, std::uint8_t rs, std::uint8_t rt, std::uint16_t value); + + void decode(Registers *regs); + void execute(); + void memory(Memory *mem); + void write_back(Registers *regs); + QVector<QString> to_strs(); private: enum InstructionArithmeticImmediateT type; + std::uint32_t rs_d, rt_d; }; #endif // ARITHMETIC_H |