-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppendixA.h
More file actions
93 lines (86 loc) · 1.89 KB
/
AppendixA.h
File metadata and controls
93 lines (86 loc) · 1.89 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
Team:
Nicholas Dibello-Hitta, cssc4049, RedID: 828490930
Dylan Agoncillo, cssc4051, RedID: 824340550
*/
#include <unordered_map>
#include <unordered_set>
#include <string>
namespace AppendixA{
static const std::unordered_map<std::string, int> registers = {
{"A", 0},
{"X", 1},
{"L", 2},
{"B", 3},
{"S", 4},
{"T", 5},
{"F", 6},
{"PC", 8},
{"SW", 9},
};
static const std::unordered_map<std::string, int> OPTAB = {
{"ADD", 0x18},
{"ADDF", 0x58},
{"ADDR", 0x90},
{"AND", 0x40},
{"CLEAR", 0xB4},
{"COMP", 0x28},
{"COMPF", 0x88},
{"COMPR", 0xA0},
{"DIV", 0x24},
{"DIVF", 0x64},
{"DIVR", 0x9C},
{"FIX", 0xC4},
{"FLOAT", 0xC0},
{"HIO", 0xF4},
{"J", 0x3C},
{"JEQ", 0x30},
{"JGT", 0x34},
{"JLT", 0x38},
{"JSUB", 0x48},
{"LDA", 0x00},
{"LDB", 0x68},
{"LDCH", 0x50},
{"LDF", 0x70},
{"LDL", 0x08},
{"LDS", 0x6C},
{"LDT", 0x74},
{"LDX", 0x04},
{"LPS", 0xD1},
{"MUL", 0x20},
{"MULF", 0x60},
{"MULR", 0x98},
{"NORM", 0xC8},
{"OR", 0x44},
{"RD", 0xD8},
{"RMO", 0xAC},
{"RSUB", 0x4C},
{"SHIFTL", 0xA4},
{"SHIFTR", 0xA8},
{"SIO", 0xF0},
{"SSK", 0xEC},
{"STA", 0x0C},
{"STB", 0x78},
{"STCH", 0x54},
{"STF", 0x80},
{"STI", 0xD4},
{"STL", 0x14},
{"STS", 0x7C},
{"STSW", 0xE8},
{"STT", 0x84},
{"STX", 0x10},
{"SUB", 0x1C},
{"SUBF", 0x5C},
{"SUBR", 0x94},
{"SVC", 0xB0},
{"TD", 0xE0},
{"TIO", 0xF8},
{"TIX", 0x2C},
{"TIXR", 0xB8},
{"WD", 0xDC}
};
static const std::unordered_set<std::string> assemblerDirective {
"START", "END", "BYTE", "WORD", "RESB", "RESW"
//double check all the directives we are covering
};
}