]> git.localhorst.tv Git - l2e.git/blob - src/common/Script.h
handle compare/jump instructions in script assembler
[l2e.git] / src / common / Script.h
1 /*
2  * Script.h
3  *
4  *  Created on: Oct 13, 2012
5  *      Author: holy
6  */
7
8 #ifndef COMMON_SCRIPT_H_
9 #define COMMON_SCRIPT_H_
10
11 namespace common {
12
13 class Script {
14
15 public:
16         Script();
17         ~Script();
18
19         enum Code {
20                 CODE_MOVE_A0,
21                 CODE_MOVE_A1,
22                 CODE_MOVE_I0,
23                 CODE_MOVE_I1,
24                 CODE_MOVE_V0,
25                 CODE_MOVE_V1,
26
27                 CODE_ADD_I0,
28                 CODE_ADD_I1,
29                 CODE_ADD_V0,
30                 CODE_ADD_V1,
31
32                 CODE_MOD_I0,
33                 CODE_MOD_I1,
34
35                 CODE_RAND_I0,
36                 CODE_RAND_I1,
37
38                 CODE_CMP_I0,
39                 CODE_CMP_I1,
40                 CODE_CMP_I0_I1,
41
42                 CODE_JUMP,
43                 CODE_JUMP_EQUAL,
44                 CODE_JUMP_NOT_EQUAL,
45                 CODE_JUMP_LESS,
46                 CODE_JUMP_LESS_EQUAL,
47                 CODE_JUMP_GREATER,
48                 CODE_JUMP_GREATER_EQUAL,
49
50                 CODE_SYSCALL,
51         };
52
53 public:
54         const unsigned char *text;
55         int textlen;
56
57 };
58
59 }
60
61 #endif /* COMMON_SCRIPT_H_ */