summaryrefslogtreecommitdiff
path: root/inc/instr.h
blob: 98ecf1d58a22e747636ba6ebf919c88d7311197d (plain)
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
#ifndef INSTR_H
#define INSTR_H
#include <functional>
#include <iostream>
#include <map>

enum Mnemonic {
	ADD,
	SUB,
	MUL,
	QUOT,
	REM,
	SFTR,
	SFTL,
	AND,
	OR,
	NOT,
	XOR,
	ADDV,
	SUBV,
	MULV,
	DIVV,
	CMP,
	CEV,
	LOAD,
	LOADV,
	ADDI,
	SUBI,
	SFTRI,
	SFTLI,
	ANDI,
	ORI,
	XORI,
	STORE,
	STOREV,
	JMP,
	JRL,
	JAL,
	BEQ,
	BGT,
	BUF,
	BOF,
	PUSH,
	POP,
};

std::ostream &operator<<(std::ostream &os, Mnemonic a);

namespace instr
{
// clang-format off
	extern const std::map<unsigned int, Mnemonic> mnemonic_map;
	extern const std::map<Mnemonic, std::function<void(signed int &s1, signed int &s2, signed int &s3)>> instr_map;
// clang-format on
} // namespace instr

#endif /* INSTR_H_INCLUDED */