summaryrefslogtreecommitdiffhomepage
path: root/asm/arm/assembler.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2024-08-31 18:29:58 +0200
committerRoland Reichwein <mail@reichwein.it>2024-08-31 18:29:58 +0200
commit02153da4d5954261f6649e2980bc88f6d29e45a6 (patch)
tree4cc1ce6d1124edf791e48fcdb28b33a614d1a358 /asm/arm/assembler.h
parentf8c4fe1614cc79df9f97c8a7754cf2a5aaf5063d (diff)
ARM assembler (WIP)
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");}
+};