From ce2071f42b22f9c0c989a3d79379230f947ae13a Mon Sep 17 00:00:00 2001 From: black Date: Thu, 12 Jun 2025 14:17:36 +0300 Subject: [PATCH] initial register implementation --- emulator/components/Register.cpp | 21 +++++++++++++++++++++ emulator/components/Register.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 emulator/components/Register.cpp create mode 100644 emulator/components/Register.h diff --git a/emulator/components/Register.cpp b/emulator/components/Register.cpp new file mode 100644 index 0000000..d80c76a --- /dev/null +++ b/emulator/components/Register.cpp @@ -0,0 +1,21 @@ +// +// Created by black on 12.06.25. +// + +#include "Register.h" + + +Register* Register::getInstance() { + if (m_instance == nullptr) { + m_instance = new Register(); + } else { + m_instance = new Register(); + } + return m_instance; +} + +void Register::setRegister() { +} + +int Register::getRegister(int r) { +} diff --git a/emulator/components/Register.h b/emulator/components/Register.h new file mode 100644 index 0000000..d8fa141 --- /dev/null +++ b/emulator/components/Register.h @@ -0,0 +1,30 @@ +// +// Created by black on 12.06.25. +// + +#ifndef REGISTER_H +#define REGISTER_H + + + +class Register { + +private: + Register() = default; + + static Register *m_instance; + +public: + static Register* getInstance(); + + void setRegister(); + + int getRegister(int r); + +}; + +Register *Register::m_instance = nullptr; + + + +#endif //REGISTER_H