-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassembler.h
More file actions
35 lines (31 loc) · 725 Bytes
/
assembler.h
File metadata and controls
35 lines (31 loc) · 725 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
#ifndef __ASSEMBLER__H__
#define __ASSEMBLER__H__
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>
#include <regex>
#include <map>
#include <string>
#include <bitset>
#include <algorithm>
#include "instruction.h"
class Assembler {
public:
string content;
vector<string> statements;
vector<vector<string>> elements;
vector<unsigned int> machine_code;
map<string, int> labels;
Assembler(string &_content) : content(_content) {}
void split();
void trim();
void format();
void calc_label();
void parse();
void print(string t = "plain", ostream &tt = cout);
unsigned int reverse_word(unsigned int);
};
#endif