-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsmex2.cpp
More file actions
34 lines (32 loc) · 709 Bytes
/
Copy pathsmex2.cpp
File metadata and controls
34 lines (32 loc) · 709 Bytes
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
#include <iostream>
#include <vector>
#include "stackmachine.hpp"
using namespace std;
int main() {
vector<string> program = {
"push 7",
"show",
"push 1",
"sub",
"jmpnz 1",
"halt"
};
vector<string> program2 = {
"push 7",
"push 3",
"cmpeq",
"jmpnz 7",
"cmpl",
"jmpnz 10",
"halt",
"push 13",
"show",
"retf",
"push 21",
"show",
"retf"
};
StackMachine sm(true);
sm.run(program2);
return 0;
}