diff options
Diffstat (limited to 'ue3/mycpu/cprogram.cpp')
| -rw-r--r-- | ue3/mycpu/cprogram.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ue3/mycpu/cprogram.cpp b/ue3/mycpu/cprogram.cpp index 03d4c30..f6fc3cb 100644 --- a/ue3/mycpu/cprogram.cpp +++ b/ue3/mycpu/cprogram.cpp | |||
| @@ -19,6 +19,19 @@ using namespace std; | |||
| 19 | CProgram::CProgram() | 19 | CProgram::CProgram() |
| 20 | { | 20 | { |
| 21 | m_instrset.insert(new CInstructionInc); | 21 | m_instrset.insert(new CInstructionInc); |
| 22 | m_instrset.insert(new CInstructionDec); | ||
| 23 | m_instrset.insert(new CInstructionAdd); | ||
| 24 | m_instrset.insert(new CInstructionSub); | ||
| 25 | m_instrset.insert(new CInstructionMul); | ||
| 26 | m_instrset.insert(new CInstructionDiv); | ||
| 27 | m_instrset.insert(new CInstructionLoad); | ||
| 28 | m_instrset.insert(new CInstructionStore); | ||
| 29 | m_instrset.insert(new CInstructionTest); | ||
| 30 | m_instrset.insert(new CInstructionLabel); | ||
| 31 | m_instrset.insert(new CInstructionJumpA); | ||
| 32 | m_instrset.insert(new CInstructionJumpZ); | ||
| 33 | m_instrset.insert(new CInstructionJumpS); | ||
| 34 | m_instrset.insert(new CInstructionWrite); | ||
| 22 | } | 35 | } |
| 23 | 36 | ||
| 24 | /*----------------------------------------------------------------------------*/ | 37 | /*----------------------------------------------------------------------------*/ |
| @@ -54,6 +67,7 @@ void CProgram::compile(std::istream& in) | |||
| 54 | continue; | 67 | continue; |
| 55 | 68 | ||
| 56 | boost::trim(line); | 69 | boost::trim(line); |
| 70 | boost::to_lower(line); | ||
| 57 | 71 | ||
| 58 | /* ignore comments */ | 72 | /* ignore comments */ |
| 59 | if (line.find_first_of('#') == 0) | 73 | if (line.find_first_of('#') == 0) |
