#+title: Aryadev's Assembly Language (AAL) #+author: Aryadev Chavali #+date: 2023-10-15 A compiler for Aryadev's Assembly Language, an assembly-like programming language, which targets the [[https://github.com/aryadev-software/avm/][AVM]]. * How to build Requires =GNU make= and a compliant C++17 compiler. Code base has been tested against =g++= and =clang=, but given how the project has been written without use of GNU'isms (that I'm aware of) it shouldn't be an issue to compile using something like =tcc= or another compiler (look at [[file:Makefile::CPP=g++][here]] to change the compiler). To build everything simply run ~make~. This will build: + [[file:asm/main.cpp][Assembler executable]] which assembles compliant assembly code to VM bytecode + [[file:examples/][Assembly examples]] which provide some source code examples on common programs one may write. Use this to figure out how to write compliant AAL. Also a good test of both the VM and assembler. You may also build each component individually through the corresponding recipe: + ~make asm~ + ~make examples~ * Lines of code #+begin_src sh :results table :exports results wc -lwc $(find -regex ".*\.[ch]\(pp\)?" -maxdepth 2) #+end_src #+RESULTS: | Files | Lines | Words | Bytes | |------------------------+-------+-------+-------| | ./asm/base.hpp | 21 | 68 | 472 | | ./asm/lexer.cpp | 565 | 1448 | 14067 | | ./asm/base.cpp | 33 | 89 | 705 | | ./asm/lexer.hpp | 106 | 204 | 1757 | | ./asm/preprocesser.cpp | 218 | 574 | 5800 | | ./asm/preprocesser.hpp | 62 | 147 | 1360 | | ./asm/main.cpp | 148 | 414 | 3791 | |------------------------+-------+-------+-------| | total | 1153 | 2944 | 27952 |