Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (28 loc) · 744 Bytes

assembler.md

File metadata and controls

40 lines (28 loc) · 744 Bytes

Assembler Documentation

Examples

Assembling the assembly file example.asm and writing the machine code to a memory file called example.mem.

python assembler.py -i input/example.asm -o output/example.mem

Input file: example.asm

add r3, r1, r2
addi r3, r1, 12

Output file: example.mem

00000000001000001000000110110011
00000000110000001000000110110011

Running Tests

python unit_test_assembler.py  -v

Should output in case you only have two tests

test_add (__main__.TestRTypeInstructions.test_add) ... ok
test_addi (__main__.TestRTypeInstructions.test_addi) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.001s

OK