/** * @module cinstruction * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) * @brief TODO * @date 10.05.2009 */ #ifndef CINSTRUCTION_H #define CINSTRUCTION_H 1 #include #include //#include "ccpu.h" /* declare CCPU */ class CCPU; /** * @class CInstruction * * TODO */ class CInstruction { public: /** * @method CInstruction * @brief Default ctor * @param - * @return - * @globalvars none * @exception none * @conditions none */ CInstruction(std::string name) : m_name(name) {}; /** * @method ~CInstruction * @brief Default dtor * @param - * @return - * @globalvars none * @exception none * @conditions none */ virtual ~CInstruction() {}; /* TODO */ virtual bool operator==(std::string& name) { return name == m_name; } /* TODO */ virtual const std::string& getName() { return m_name; } /* TODO */ virtual std::ostream& dump(std::ostream& stream) { stream << m_name; return stream; } /* TODO */ friend std::ostream& operator<<(std::ostream& stream, CInstruction& instr) { return instr.dump(stream); } /* TODO */ virtual const unsigned parseRegister(const std::string& str); /* TODO */ virtual void checkRegister(CCPU *cpu, unsigned regidx); /* TODO */ virtual CInstruction *factory() = 0; /* TODO */ virtual void compile(std::list& params) = 0; /* TODO */ virtual void execute(CCPU *cpu) = 0; protected: /* members */ std::string m_name; }; #endif /* vim: set et sw=2 ts=2: */