added "lw" and "sw"

This commit is contained in:
black
2025-07-07 17:58:43 +02:00
parent ed8f732545
commit a857953d25
4 changed files with 49 additions and 9 deletions

View File

@@ -10,22 +10,25 @@
/// Als Hauptspeicher wird ein Array genutzt.
class Memory {
private:
Memory() = default;
Memory();
/// Singleton instance
static Memory *m_instance;
/// Hauptspeicher (hier 32 kB groß)
std::array<int, 8192> m_memory;
std::array<int, 8192> m_memory{};
public:
/// Singleton Logik
Memory(const Memory &) = delete;
Memory(const Memory &&) = delete;
Memory &operator=(const Memory &) = delete;
Memory &operator=(const Memory &&) = delete;
~Memory() = default;
/**
@@ -49,9 +52,7 @@ public:
* @return Der Wert aus der Adresse
*/
int load(int address) const;
};
#endif //MEMORY_H