disasm/sim: changed interface, branch => br, features++
[calu.git] / 3b_sim / ccpu.hpp
index 89867efc9c8f13345622bc9dc7cb65fe102cec8f..e428f630dd637dcf0e5cdbcb5c53af1ed0140316 100644 (file)
@@ -1,36 +1,51 @@
-
-
 #ifndef __CPU__H__
 #define __CPU__H__
 
 #include "cdat.hpp"
 #include "cmem.hpp"
 #include "cpmem.hpp"
+
+class Iinstr;
+
 #include "Iinstr.hpp"
 
+
 class CCpu {
        private:
 
+               bool m_Z, m_S, m_C, m_O;
+
                CDat m_pc, m_pc_next;
-               CMem<CDat> m_regfile, m_ram;
+               CMem<CDat> m_reg, m_ram;
                CPMem<Iinstr*> m_prog;
 
+               CDat m_stack;
+
        public:
                void registerExtension() {};
                void tick();
 
                CDat getRegister(const int) const;
-               void setRegister(const int, CDat&);
+               void setRegister(const int, CDat);
 
                CDat getRAM(const int) const;
-               void setRAM(const int, CDat&);
+               void setRAM(const int, CDat);
 
                Iinstr* getProg(const int) const;
                void setProg(const int, Iinstr*);
 
-               CDat getNextPC() const;
+               CDat getCurPC() const;
+               void setNextPC(CDat);
+
+               void updateFlags(CDat);
+               void updateFlags(bool z, bool o, bool c, bool s);
+
+               bool conditionMet(short);
+
+               int getStack() const;
+               void setStack(const int);
 
-               CCpu();
+               CCpu(int,int,int);
 
 };