mipsler banner

mipsler

1 devlog
15h 21m 40s

MIPS architecture assembler & simulator

Repository

Loading README...

Pedro B.

Quite a late first devlog. Basically this is an all-in-one MIPS assembler + simulator in Go, which I hope will be able to fully run MIPS assembly programs.

15 hours in, no GUI, but I have finished the assembler! This is perhaps the easiest part of the project, just a simple lexer & parser that emits the correctly formatted opcodes.

An interesting bit of this project has been learning how to use Go’s “testing” library, which definitely caught a lot of mistakes, and saved me a lot of trouble. The bulk of the code for the assembler is an enormous jump-table that handles all of the opcodes, with a bunch of similar-but-not-really functions, and with all of the copy-pasting I did there were a lot of incorrect bits that the test cases caught! Hooray for TDD…

Otherwise, not a lot to report, and very few screenshots (an assembler that emits numbers is not particularly exciting.) I’m now moving on to the simulator (which I have as “emulator” in my actual code, cuz NES muscle-memory,) which already runs, like, 3 instructions, so this should be easy :-D <- clueless

Wish me luck!

(P.S.: Attachment is hard to read; it’s just assembling the code, and running it [the “BREAK! 1 2 3” in the end is the simulator reaching the end and breaking; 1 2 3 are the states of the $s0, $t0 and $t1 registers {correct values!!!}])

Attachment
0