From 89e202f49b9857dcd3627fbc4e0262125d729bbc Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 13 May 2009 04:09:39 +0200 Subject: adding all instructions and displays --- ue3/mycpu/ccpu.h | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 78 insertions(+), 6 deletions(-) (limited to 'ue3/mycpu/ccpu.h') diff --git a/ue3/mycpu/ccpu.h b/ue3/mycpu/ccpu.h index e28a7cc..1ef1923 100644 --- a/ue3/mycpu/ccpu.h +++ b/ue3/mycpu/ccpu.h @@ -8,11 +8,12 @@ #ifndef CCPU_H #define CCPU_H 1 -#include #include +#include #include "cdat.h" #include "cmem.h" #include "cprogram.h" +#include "cdisplay.h" /** * @class CCPU @@ -53,7 +54,7 @@ class CCPU * @exception none * @conditions none */ - const unsigned getRegisterCount() + const unsigned getRegisterCount() const { return m_regcnt; } @@ -67,7 +68,7 @@ class CCPU * @exception none * @conditions none */ - CDat *getRegisters() + CDat *getRegisters() const { return m_registers; } @@ -81,7 +82,7 @@ class CCPU * @exception none * @conditions none */ - void setMemory(const CMem *memory) + void setMemory(CMem *memory) { m_memory = memory; } @@ -95,7 +96,7 @@ class CCPU * @exception none * @conditions none */ - const CMem *getMemory() + CMem *getMemory() const { return m_memory; } @@ -128,6 +129,76 @@ class CCPU return m_program; } + /** + * @method getDisplays + * @brief get set of pointers to displays + * @param - + * @return reference to set of pointers to displays + * @globalvars none + * @exception none + * @conditions none + */ + const std::set& getDisplays() + { + return m_displays; + } + + /** + * @method setFlagZero + * @brief set zero flag + * @param value new value of zero flag + * @return - + * @globalvars none + * @exception none + * @conditions none + */ + void setFlagZero(const bool value) + { + m_flagzero = value; + } + + /** + * @method getFlagZero + * @brief get value of zero flag + * @param - + * @return value of zero flag + * @globalvars none + * @exception none + * @conditions none + */ + const bool getFlagZero() + { + return m_flagzero; + } + + /** + * @method setFlagSign + * @brief set sign flag + * @param value new value of sign flag + * @return - + * @globalvars none + * @exception none + * @conditions none + */ + void setFlagSign(const bool value) + { + m_flagsign = value; + } + + /** + * @method getFlagSign + * @brief get value of sign flag + * @param - + * @return value of sign flag + * @globalvars none + * @exception none + * @conditions none + */ + const bool getFlagSign() + { + return m_flagsign; + } + /** * @method run * @brief execute current program @@ -156,8 +227,9 @@ class CCPU /* members */ CDat *m_registers; unsigned m_regcnt; - const CMem *m_memory; + CMem *m_memory; const CProgram *m_program; + std::set m_displays; bool m_flagzero; bool m_flagsign; }; -- cgit v1.2.3