aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/registers.h
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-11-19 21:23:04 +0100
committerKarel Kočí <cynerd@email.cz>2017-11-19 21:23:04 +0100
commitf0ad502e4651243d6a96194b3393bd460c0f7fc9 (patch)
tree4f912c24b5943bd93b5a3378df75f9611de6779b /qtmips_machine/registers.h
parent2c6562fa78e884d66b8c2a306f020101e8803f2e (diff)
downloadqtmips-f0ad502e4651243d6a96194b3393bd460c0f7fc9.tar.gz
qtmips-f0ad502e4651243d6a96194b3393bd460c0f7fc9.tar.bz2
qtmips-f0ad502e4651243d6a96194b3393bd460c0f7fc9.zip
Another huge pile of work for about two months
Well I should commit every change instead of this madness. I am not documenting changes as all this is just improvements and implementation progression.
Diffstat (limited to 'qtmips_machine/registers.h')
-rw-r--r--qtmips_machine/registers.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/qtmips_machine/registers.h b/qtmips_machine/registers.h
index a550f4a..905a212 100644
--- a/qtmips_machine/registers.h
+++ b/qtmips_machine/registers.h
@@ -8,18 +8,22 @@ class Registers : public QObject {
Q_OBJECT
public:
Registers();
+ Registers(const Registers*);
- std::uint32_t read_pc(); // Return current value of program counter
+ std::uint32_t read_pc() const; // Return current value of program counter
std::uint32_t pc_inc(); // Increment program counter by four bytes
std::uint32_t pc_jmp(std::int32_t offset); // Relative jump from current location in program counter
void pc_abs_jmp(std::uint32_t address); // Absolute jump in program counter (write to pc)
- std::uint32_t read_gp(std::uint8_t i); // Read general-purpose register
+ std::uint32_t read_gp(std::uint8_t i) const; // Read general-purpose register
void write_gp(std::uint8_t i, std::uint32_t value); // Write general-purpose register
- std::uint32_t read_hi_lo(bool hi); // true - read HI / false - read LO
+ std::uint32_t read_hi_lo(bool hi) const; // true - read HI / false - read LO
void write_hi_lo(bool hi, std::uint32_t value);
+ bool operator ==(const Registers &c) const;
+
signals:
+ void pc_update(std::uint32_t val);
// TODO signals
private: