summaryrefslogtreecommitdiffhomepage
path: root/asm/arm/assembler.h
diff options
context:
space:
mode:
Diffstat (limited to 'asm/arm/assembler.h')
-rw-r--r--asm/arm/assembler.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/asm/arm/assembler.h b/asm/arm/assembler.h
new file mode 100644
index 0000000..13eca00
--- /dev/null
+++ b/asm/arm/assembler.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "instruction.h"
+#include "parse.h"
+
+class Encoding
+{
+};
+
+class OpCode: public Encoding
+{
+private:
+ Instruction _instruction;
+ std::vector<std::string> _arguments;
+};
+
+class Data: public Encoding
+{
+};
+
+using Assembly = std::vector<Encoding>;
+
+class Assembler
+{
+public:
+ Assembler(){}
+
+// passes:
+// 0. parse
+// 1. assign sizes and offsets to codes (assign labels)
+// 2. assemble to code sequence (use labels for offsets)
+
+ code_sequence encode(const std::string& source){ throw std::runtime_error("Assembler.encode unimplemented");}
+ std::string decode(code_sequence) { throw std::runtime_error("Assembler.decode unimplemented");}
+};