-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVM.h
50 lines (43 loc) · 1.21 KB
/
VM.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef VM_H_
#define VM_H_
#include "memory.h"
#include <functional>
class VM {
public:
void run();
VM(std::string file);
private:
std::vector<std::function<void(numtype)>> prepareInstructions();
std::vector<char> input;
// #0. Conditional Move.
void condMove(numtype num);
// #1. Array Index.
void arrayIndex(numtype num);
// #2. Array Amendment.
void arrayAmendment(numtype num);
// #3. Addition.
void addition(numtype num);
// #4. Multiplication.
void multiplication(numtype num);
// #5. Division.
void division(numtype num);
// #6. Not-And.
void notAnd(numtype num);
// #7. Halt.
void halt(numtype num);
// #8. Allocation.
void allocation(numtype num);
// #9. Abandonment.
void abandonment(numtype num);
// #10. Output.
void output(numtype num);
// #11. Input.
void inputcmd(numtype num);
// #12. Load Program.
void loadProgram(numtype num);
// #13. Orthography.
void orthography(numtype num);
std::vector<numtype> reg;
Memory mem;
};
#endif