-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtypes.c
95 lines (92 loc) · 1.32 KB
/
types.c
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include "types.h"
uint8_t opcode_to_num_inputs[] = {
/* ADD */ 2,
/* SUB */ 2,
/* BRR */ 2,
/* LT */ 2,
/* EQ */ 2,
/* DUP */ 1,
/* NEG */ 1,
/* MER (this is a bit of a lie, there's two arguments for MER, but this will simply things
if the machine thinks there's only one instruction. */ 1,
/* NTG */ 1,
/* ITG */ 1,
/* GT */ 2,
/* SIL */ 2,
/* CTG */ 2,
/* RTD */ 2,
/* ETG */ 1,
/* MUL */ 2,
/* XOR */ 2,
/* AND */ 2,
/* OR */ 2,
/* SHL */ 2,
/* SHR */ 2,
/* NEQ */ 2,
/* OPN */ 2,
/* RED */ 1,
/* WRT */ 2,
/* CLS */ 1,
/* GTE */ 2,
/* LTE */ 2,
/* HLT */ 1,
/* LOD */ 2,
/* LS */ 1,
/* SDF */ 2,
/* ULK */ 1,
/* LSK */ 2,
/* RND */ 1,
};
/* Not actually used, please change code in instruction_store.c */
opcode_type privileged_opcodes[] = {
OPN,
RED,
WRT,
CLS,
HLT,
LOD,
LS,
SDF,
ULK,
LSK,
RND,
};
#ifdef DEBUG
char* opcode_to_name[] = {
"ADD",
"SUB",
"BRR",
"LT",
"EQ",
"DUP",
"NEG",
"MER",
"NTG",
"ITG",
"GT",
"SIL",
"CTG",
"RTD",
"ETG",
"MUL",
"XOR",
"AND",
"OR",
"SHL",
"SHR",
"NEQ",
"OPN",
"RED",
"WRT",
"CLS",
"GTE",
"LTE",
"HLT",
"LOD",
"LS",
"SDF",
"ULK",
"LSK",
"RND",
};
#endif