French for "sick," something you become if you have to write too much code in it.
- Andrew S. Tanenbaum
MAL is an assembler for the amic-0 Micro-Assembly Language.
The project is built with Gradle. The required version is
automatically downloaded by the wrapper, so simply clone the repository and run
the build task:
$ git clone https://github.com/albmoriconi/mal.git
$ cd mal
$ ./gradlew buildThe built program archives with executables and library dependencies can be
found in the build/distributions directory.
To build the Javadoc for the project, run the javadoc Gradle task. The
produced documentation can be found in the build/docs/javadoc directory.
usage: mal [options] <input>
Assembler for MIC-1 Micro-Assembly language
options:
-f <format> output format: binary (default) | text
-h,--help display this help and exit
-o <file> write output to <file>
The language is based on the MIC-1 MAL, clearly described in Tanenbaum (2013). This section describes the changes made to its syntax and semantics.
The language is case sensitive. Statements are lower case, register names are upper case.
Comments go from a # character to the end of line.
Two kinds of statements have been added: empty, that means that no bus, memory
or ALU operation is made during the cycle, and halt, that translates to an
empty instruction that has its address in the next address field.
The syntax for labels is label [= address]: where the optional address is
hexadecimal, prefixed with 0x, and specifies the instruction position in the
control store.
- Tanenbaum, A.S, and Austin, T. (2013). Structured Computer Organization (6th ed.). Pearson.