-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
79 lines (69 loc) · 1.98 KB
/
Copy pathmain.cpp
File metadata and controls
79 lines (69 loc) · 1.98 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include "rule.h"
#include <iostream>
int main()
{
rule_manager test;
std::optional<rule_index> rule1 = test.add_rule();
if (rule1.has_value() == false)
return 0;
std::optional<rule*> rule_ptr_result = test.get_rule(rule1.value());
if (rule_ptr_result.has_value() == false)
return 0;
rule* rule_1_ptr = rule_ptr_result.value();
rule_1_ptr->add_command(
command_type::mov,
variable_common(0),
immediate(static_cast<var_single>(operand_type::variable_common))
);
rule_1_ptr->add_command(
command_type::mov,
variable_common(1),
immediate(6)
);
rule_1_ptr->add_command(
command_type::mov,
variable_common(2),
immediate(static_cast<var_single>(operand_type::immediate))
);
rule_1_ptr->add_command(
command_type::mov,
variable_common(3),
immediate(999897)
);
rule_1_ptr->add_command(
command_type::mov,
variable_common(4),
immediate(static_cast<var_single>(operand_type::variable_common))
);
rule_1_ptr->add_command(
command_type::mov,
variable_common(5),
immediate(6)
);
rule_1_ptr->add_command(
command_type::mov,
variable_common(6),
immediate(static_cast<var_single>(operand_type::immediate))
);
rule_1_ptr->add_command(
command_type::mov,
variable_common(7),
immediate(1)
);
rule_1_ptr->add_command(
command_type::acmd,
immediate(static_cast<size_t>(command_type::mov)),
variable_common(0),
variable_common(9)
);
rule_1_ptr->add_command(
command_type::acmd,
immediate(static_cast<size_t>(command_type::ret)),
variable_common(4),
variable_common(9)
);
test.set_begin(rule1.value());
std::vector<var_single> result;
test.run(result);
return 0;
}