#+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 echo 'Files Lines Words Characters' wc -lwc $(find src/ -regex ".*\.[ch]\(pp\)?") | awk '{print $4 "\t" $1 "\t" $2 "\t" $3}' #+end_src #+RESULTS: |----------------------+-------+-------+------------| | Files | Lines | Words | Characters | |----------------------+-------+-------+------------| | src/lexer.hpp | 133 | 308 | 2899 | | src/main.cpp | 161 | 460 | 4076 | | src/base.hpp | 25 | 113 | 741 | | src/lexer.cpp | 613 | 1647 | 17888 | | src/base.cpp | 37 | 134 | 976 | | src/preprocesser.cpp | 273 | 1013 | 9103 | | src/preprocesser.hpp | 80 | 227 | 2068 | |----------------------+-------+-------+------------| | total | 1322 | 3902 | 37751 | |----------------------+-------+-------+------------|