From 02153da4d5954261f6649e2980bc88f6d29e45a6 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 31 Aug 2024 18:29:58 +0200 Subject: ARM assembler (WIP) --- asm/arm/assembler.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 asm/arm/assembler.h (limited to 'asm/arm/assembler.h') 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 +#include + +#include "instruction.h" +#include "parse.h" + +class Encoding +{ +}; + +class OpCode: public Encoding +{ +private: + Instruction _instruction; + std::vector _arguments; +}; + +class Data: public Encoding +{ +}; + +using Assembly = std::vector; + +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");} +}; -- cgit v1.2.3