-
-
#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);
};