A MIPS assembler that translates .asm files into .hex machine code for a custom processor.
Demonstrates parsing, instruction encoding, symbol resolution, and output generation; hardware access is not required.
- Parsing, lexing, and tokenization of MIPS assembly
- Symbol table management and label resolution
- Instruction encoding into
.hexformat - Input validation and error handling
- Modular design for future instruction set extensions
- Targets a custom processor; physical hardware not required
- Only a subset of instructions is supported, scoped specifically for this project
- Testing is done via provided
.asmfiles and expected.hexoutput - Design prioritizes correctness and clarity, with future extensibility considered
- Clone repository:
git clone https://github.com/SearParsley/mips-assembler.git
cd mips-assembler- Assemble a file:
python assembler.py tests/task1_test1.asm- Output:
output.hex:
v3.0 hex words addressed
00: 5040 508a 3282 5241 4002Reviewers can inspect
output.hexanddata.hexto verify the assembler logic without needing the processor.