Configurable mips assembler written in haskell.
The main goal of this project is to make it easier for anyone who wants to implement a mips processor to write assembly code when they test their implementation, since translating assembly by hand to machine code is slow, hard and error-prone.
Currently the assembler only supports a subset of instructions (which are usually implemented by students), labels and comments.
Section declarations or variables are not supported.
Error handling is quite limited.
The code should work on both Unix and Windows systems.
In order to build the project the stack
build tool (usually named haskell-stack
) is required.
git clone https://github.com/icsaszar/mips-assembler-hs.git
cd mips-assembler-hs
stack build
stack run -- --sep res/test.mips
mips-assembler-exe --sep res/test.mips
You can edit the opcodes and alu functions in the config/codes.json
file to match with your mips design.
Running the tests after building the project is encouraged.
There are some basic unit tests written using Tasty and HUnit.
stack test
The blackbox tests are written in python with the pytest library.
cd ./test
pytest