summaryrefslogtreecommitdiffstats
path: root/ue3/mycpu/instructions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ue3/mycpu/instructions.cpp')
-rw-r--r--ue3/mycpu/instructions.cpp27
1 files changed, 27 insertions, 0 deletions
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 @@
1/**
2 * @module instructions
3 * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348)
4 * @brief TODO
5 * @date 10.05.2009
6 */
7
8#include "instructions.h"
9
10using namespace std;
11
12void CInstructionInc::compile(std::list<std::string>& params)
13{
14 if (params.size() != 1)
15 throw runtime_error("Invalid paramater count - must be 1");
16 m_regidx1 = parseRegister(params.front());
17}
18
19/*----------------------------------------------------------------------------*/
20
21void CInstructionInc::execute(CCPU *cpu)
22{
23 checkRegister(cpu, m_regidx1);
24 cpu->getRegisters()[m_regidx1]++;
25}
26
27/* vim: set et sw=2 ts=2: */