diff options
| author | manuel <manuel@nc8430.lan> | 2009-05-12 23:18:17 +0200 |
|---|---|---|
| committer | manuel <manuel@nc8430.lan> | 2009-05-12 23:18:17 +0200 |
| commit | 45581d3d376e8deed84952cb838ae330549e5241 (patch) | |
| tree | ab23bd5cc1f2e32e95faa372b3b46e69ccb6a3c3 /ue3/mycpu/instructions.cpp | |
| parent | fe1ef6b47f59899e8687bb1dcc92eba1d103a08f (diff) | |
| download | ooprog-45581d3d376e8deed84952cb838ae330549e5241.tar.gz ooprog-45581d3d376e8deed84952cb838ae330549e5241.tar.bz2 ooprog-45581d3d376e8deed84952cb838ae330549e5241.zip | |
my cpu design
Diffstat (limited to 'ue3/mycpu/instructions.cpp')
| -rw-r--r-- | ue3/mycpu/instructions.cpp | 27 |
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 | |||
| 10 | using namespace std; | ||
| 11 | |||
| 12 | void 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 | |||
| 21 | void 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: */ | ||
