summaryrefslogtreecommitdiffstats
path: root/ue3/mycpu/cinstruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'ue3/mycpu/cinstruction.h')
-rw-r--r--ue3/mycpu/cinstruction.h98
1 files changed, 98 insertions, 0 deletions
diff --git a/ue3/mycpu/cinstruction.h b/ue3/mycpu/cinstruction.h
new file mode 100644
index 0000000..b16c067
--- /dev/null
+++ b/ue3/mycpu/cinstruction.h
@@ -0,0 +1,98 @@
1/**
2 * @module cinstruction
3 * @author Guenther Neuwirth (0626638), Manuel Mausz (0728348)
4 * @brief TODO
5 * @date 10.05.2009
6 */
7
8#ifndef CINSTRUCTION_H
9#define CINSTRUCTION_H 1
10
11#include <iostream>
12#include <list>
13//#include "ccpu.h"
14
15/* declare CCPU */
16class CCPU;
17
18/**
19 * @class CInstruction
20 *
21 * TODO
22 */
23class CInstruction
24{
25 public:
26 /**
27 * @method CInstruction
28 * @brief Default ctor
29 * @param -
30 * @return -
31 * @globalvars none
32 * @exception none
33 * @conditions none
34 */
35 CInstruction(std::string name)
36 : m_name(name)
37 {};
38
39 /**
40 * @method ~CInstruction
41 * @brief Default dtor
42 * @param -
43 * @return -
44 * @globalvars none
45 * @exception none
46 * @conditions none
47 */
48 virtual ~CInstruction()
49 {};
50
51 /* TODO */
52 virtual bool operator==(std::string& name)
53 {
54 return name == m_name;
55 }
56
57 /* TODO */
58 virtual const std::string& getName()
59 {
60 return m_name;
61 }
62
63 /* TODO */
64 virtual std::ostream& dump(std::ostream& stream)
65 {
66 stream << m_name;
67 return stream;
68 }
69
70 /* TODO */
71 friend std::ostream& operator<<(std::ostream& stream, CInstruction& instr)
72 {
73 return instr.dump(stream);
74 }
75
76 /* TODO */
77 virtual const unsigned parseRegister(const std::string& str);
78
79 /* TODO */
80 virtual void checkRegister(CCPU *cpu, unsigned regidx);
81
82 /* TODO */
83 virtual CInstruction *factory() = 0;
84
85 /* TODO */
86 virtual void compile(std::list<std::string>& params) = 0;
87
88 /* TODO */
89 virtual void execute(CCPU *cpu) = 0;
90
91 protected:
92 /* members */
93 std::string m_name;
94};
95
96#endif
97
98/* vim: set et sw=2 ts=2: */