-
Notifications
You must be signed in to change notification settings - Fork 0
/
IS.h
78 lines (65 loc) · 1.14 KB
/
IS.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
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
/*
* @author Elio Yang
* @email jluelioyang2001@gamil.com
* @date 2021/8/23
*/
#ifndef ECC_IS_H
#define ECC_IS_H
//instruction set definitions
#include "ecc-def.h"
//whole supported instructions
/*
IMM <num> : move <num> into ax
LOADC : load a 'char' to ax(ax store addr so *ax is ok)
LOADI : load a 'int64_t' to ax
STOREC/I : store the data in ax to addr ,addr is stored in stack(by sp)
PUSH : push ax into stack
JMP <addr> : unconditional jump
JZ/JNZ : ax=0 is condition
...
//TODO complete description
*/
enum {
LEA,
IMM,
JMP,
CALL,
JZ,
JNZ,
ENT,
ADJ,
LEV,
RET,
LOADI,
LOADC,
STOREI,
STOREC,
PUSH,
OR,
XOR,
AND,
EQ,
NE,
LT,
GT,
LE,
GE,
SHL,
SHR,
ADD,
SUB,
MUL,
DIV,
MOD,
OPEN,
READ,
CLOS,
PRTF,
MALC,
MSET,
MCMP,
EXIT
};
int64_t eval();
void reg_init();
#endif //ECC_IS_H