diff options
| author | manuel <manuel@nc8430.lan> | 2009-05-13 16:55:17 +0200 |
|---|---|---|
| committer | manuel <manuel@nc8430.lan> | 2009-05-13 16:55:17 +0200 |
| commit | 3c6f886d5a8bfd36c796b963d6e3178ad9577742 (patch) | |
| tree | 7a65d184e66c810777d18ea208931910c91b7e43 /ue3/mycpu/instructions.cpp | |
| parent | 431bbac5a99abbccf33500e22aa353ec792eff94 (diff) | |
| download | ooprog-3c6f886d5a8bfd36c796b963d6e3178ad9577742.tar.gz ooprog-3c6f886d5a8bfd36c796b963d6e3178ad9577742.tar.bz2 ooprog-3c6f886d5a8bfd36c796b963d6e3178ad9577742.zip | |
* added documentation (no more TODOs)
* added testsuite + testcase
* used copyctor instead of assign operator more often
Diffstat (limited to 'ue3/mycpu/instructions.cpp')
| -rw-r--r-- | ue3/mycpu/instructions.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ue3/mycpu/instructions.cpp b/ue3/mycpu/instructions.cpp index a6ac611..c2ce096 100644 --- a/ue3/mycpu/instructions.cpp +++ b/ue3/mycpu/instructions.cpp | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /** | 1 | /** |
| 2 | * @module instructions | 2 | * @module instructions |
| 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) | 3 | * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348) |
| 4 | * @brief TODO | 4 | * @brief Implementations of CInstruction |
| 5 | * @date 10.05.2009 | 5 | * @date 10.05.2009 |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| @@ -162,7 +162,7 @@ void CInstructionLoad::execute(CCPU *cpu) | |||
| 162 | { | 162 | { |
| 163 | checkRegister(cpu, m_regidx1); | 163 | checkRegister(cpu, m_regidx1); |
| 164 | checkRegister(cpu, m_regidx2); | 164 | checkRegister(cpu, m_regidx2); |
| 165 | CDat val = cpu->getRegisters()[ m_regidx2 ]; | 165 | CDat val(cpu->getRegisters()[ m_regidx2 ]); |
| 166 | cpu->getRegisters()[ m_regidx1 ] = (*cpu->getMemory())[ val ]; | 166 | cpu->getRegisters()[ m_regidx1 ] = (*cpu->getMemory())[ val ]; |
| 167 | } | 167 | } |
| 168 | 168 | ||
| @@ -184,7 +184,7 @@ void CInstructionStore::execute(CCPU *cpu) | |||
| 184 | { | 184 | { |
| 185 | checkRegister(cpu, m_regidx1); | 185 | checkRegister(cpu, m_regidx1); |
| 186 | checkRegister(cpu, m_regidx2); | 186 | checkRegister(cpu, m_regidx2); |
| 187 | CDat val = cpu->getRegisters()[ m_regidx2 ]; | 187 | CDat val(cpu->getRegisters()[ m_regidx2 ]); |
| 188 | (*cpu->getMemory())[ val ] = cpu->getRegisters()[ m_regidx1 ]; | 188 | (*cpu->getMemory())[ val ] = cpu->getRegisters()[ m_regidx1 ]; |
| 189 | } | 189 | } |
| 190 | 190 | ||
