Asteroids.asm
Working in assembly, especially with other people, is pretty fun but a lot harder than you expect. Without a strict convention on how to work with registers, it's very easy to ruin a project. Here are some quick takeaways:
- Use a decent IDE - It's hard to run assembly programs, especially if they use a bitmap display, without explaining the setup. My go-to is MARS IDE, but you can use whatever you want.
-
Comment every line - I mean legit every line, unless
it's so self explanatory that a child could figure it out.
Here's an example:
move $a0, $t0 # need to check this value for user! li $v0, 1 # syscall for print_int syscall - Use a debugger - I've watched people stare at their code like it's gonna magically start working, dropping an hour on using their brain as an interpreter before finally using a debugger. It's assembly. Save yourself the time. Go line by line. You don't have a choice.
- Keep it simple - A lot of times, you don't even need abstractions. For example, when I was coding Frogger, I spent a day on implementing a linked list and my own malloc, until I realized a single static queue was good enough. Trees and linked lists were invented by your algo course to keep you down.