aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/instructions/arithmetic.h
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-09-05 00:31:13 +0200
committerKarel Kočí <cynerd@email.cz>2017-09-05 00:31:13 +0200
commit04ea2670be26291a17808bd704ce3549795953a0 (patch)
tree3beb72850745b014eb3ed5eb2e88bfe565c8d2df /qtmips_machine/instructions/arithmetic.h
parentccf2283819a631cec62ceaec233ee845f28d59d8 (diff)
downloadqtmips-04ea2670be26291a17808bd704ce3549795953a0.tar.gz
qtmips-04ea2670be26291a17808bd704ce3549795953a0.tar.bz2
qtmips-04ea2670be26291a17808bd704ce3549795953a0.zip
Add some more instructions to be decoded and arithmetic I test
Diffstat (limited to 'qtmips_machine/instructions/arithmetic.h')
-rw-r--r--qtmips_machine/instructions/arithmetic.h14
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