From 45581d3d376e8deed84952cb838ae330549e5241 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 12 May 2009 23:18:17 +0200 Subject: my cpu design --- ue3/mycpu/instructions.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ue3/mycpu/instructions.cpp (limited to 'ue3/mycpu/instructions.cpp') diff --git a/ue3/mycpu/instructions.cpp b/ue3/mycpu/instructions.cpp new file mode 100644 index 0000000..c283e57 --- /dev/null +++ b/ue3/mycpu/instructions.cpp @@ -0,0 +1,27 @@ +/** + * @module instructions + * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) + * @brief TODO + * @date 10.05.2009 + */ + +#include "instructions.h" + +using namespace std; + +void CInstructionInc::compile(std::list& params) +{ + if (params.size() != 1) + throw runtime_error("Invalid paramater count - must be 1"); + m_regidx1 = parseRegister(params.front()); +} + +/*----------------------------------------------------------------------------*/ + +void CInstructionInc::execute(CCPU *cpu) +{ + checkRegister(cpu, m_regidx1); + cpu->getRegisters()[m_regidx1]++; +} + +/* vim: set et sw=2 ts=2: */ -- cgit v1.2.3