15 * @brief Thrown on illegal instructions
17 * Thrown on illegal instructions, the opcode is available.
19 class IllegalInstruction
: public util::Exception
{
21 IllegalInstruction(word opcode
)
22 : Exception( util::format("Illegal Instruction: %x") % opcode
) {}
28 * \brief An interface for all instructions on the chip.
30 * An interface for all instructions on the chip.
31 * It has a method for executing instructions on the Core
32 * and tracing (pretty printing) them.
37 virtual ~Instruction() {}
41 * Executes an instruction on the Core.
43 virtual int operator()(Core
*core
) const = 0;
46 * Pretty prints an instruction
48 virtual int trace(Core
*core
, std::ostream
& ostr
) const = 0;
51 * Returns whether the instruction has 2 words or just 1.
53 virtual bool is2Word() const { return false; }
58 #endif /*INSTRUCTION_H*/