-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhex.hpp
More file actions
50 lines (41 loc) · 868 Bytes
/
hex.hpp
File metadata and controls
50 lines (41 loc) · 868 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef HEX_HPP
#define HEX_HPP
//===---------------------------------------------------------------------===//
// Hex enumeration definitions and conversion functions.
//===---------------------------------------------------------------------===//
namespace hex {
enum Instr {
LDAM = 0x0,
LDBM = 0x1,
STAM = 0x2,
LDAC = 0x3,
LDBC = 0x4,
LDAP = 0x5,
LDAI = 0x6,
LDBI = 0x7,
STAI = 0x8,
BR = 0x9,
BRZ = 0xA,
BRN = 0xB,
OPR = 0xD,
PFIX = 0xE,
NFIX = 0xF,
};
enum OprInstr {
BRB = 0x0,
ADD = 0x1,
SUB = 0x2,
SVC = 0x3
};
enum class Syscall {
EXIT = 0,
WRITE = 1,
READ = 2,
NUM_VALUES
};
const char *instrEnumToStr(Instr instr);
const char *oprInstrEnumToStr(OprInstr oprInstr);
const char *syscallEnumToStr(Syscall syscall);
const int MAX_MEMORY_SIZE_WORDS = 200000;
} // End namespace hex.
#endif // HEX_HPP