EIPAASM -> EIPA IMAGE
Find a file
2023-09-19 22:32:26 +02:00
header Add dynamic buffers and reduce memory usage 2023-09-19 22:32:26 +02:00
src Add dynamic buffers and reduce memory usage 2023-09-19 22:32:26 +02:00
test Snapshot of non working code where I now forgot what I was doing... 2023-08-17 21:43:38 +02:00
.clang-format The commit before this one also contained: 2023-02-27 14:52:37 +01:00
.gitignore Add emacs specific things to .gitignore 2023-08-17 21:30:36 +02:00
dependency_setup.sh Fix dependency_setup.sh 2023-09-07 22:45:56 +02:00
design.txt Add label support to error detection 2023-09-05 00:42:36 +02:00
LICENSE The commit before this one also contained: 2023-02-27 14:52:37 +01:00
Makefile Add the shash library into the source tree 2023-04-13 23:05:54 +02:00
README.md fix typo 2023-09-07 22:04:47 +02:00
TODO.txt Update TODO 2023-03-19 14:17:24 +01:00

Assembler

CLI application written in C

The assembler converts the written assembly into a memory image for the EIPA processor. This memory image then contains the instructions in as machiene code which is readable by the EIPA processor

It is basically made up of 4 building blocks:

1. lexer

The lexer takes the file with the written assembly and converts it into the individual components (tokens). It also takes into account if, for example, there are multiple spaces between the parts of the instruction, so that the other parts of the assembler do not have to worry about that. It converts e.g. the line INP 31 ; A comment into the parts |INP|, |31|, |end of instruction|.

2. error analyzer

The error analyzer takes the tokens from the lexer, and checks e.g. if the address of an instruction is too large, if an instruction that needs an address has one, if there are any typos, etc. If it finds an error, it aborts the program.

3. target code generator

The target code generator converts the tokens from the lexer, after checking them for errors, into machine code readable by the EIPA processor.

4. image saver

The image saver stores the generated machine code in an EIPA memory image, which can then be loaded into memory by the processor and executed.

The design of the expected assembly code is described in design.txt.

Building

Dependencies

You need to have

  1. a compiler
  2. make

installed on your system. While clang is being used by default, you can also use another compiler (e.g. gcc) by running export CC=yourcompiler or by changing 'clang' at the top of Makefile and dependency_setup.sh (where the variable CC is defined) to your preferred compiler.

To install the simple_hashtable library required for the Assembler, you can run the dependency_setup.sh file, or manually compile the library and place it in lib/shash.o.

Finally, run make to get build the Assembler to build/eipaasm