Interesting tutorial. But now that the development of the MIPS architecture as ended, it would be cool to have an equivalent in RISC-V. Not that there is anything wrong with deprecated architectures (I personally like 6502).
Do you know any particularly good resource for 6502 assembly? I’ve looked at the instruction set listings and a few programs, and it seems simple and easy enough to familiarise oneself with; but I’d love a text that goes into more detail on common techniques, patterns and optimisations.
I recommend “Assembly Lines: The Complete Book” by Roger Wagner and edited by Chris Torrence but it is more specific to the Apple ][. If you’re interested, you can get it directly from Chris’ website (including a spiffy spiral bound edition) and Roger receives a bigger cut than on a certain well-known online store.
Chibiakuma’s learnasm.net and youtube channel have some introduction to RISC-V assembler.
It was sufficient for me to get up and running.
Nice tutorial; I’d also recommend watching https://www.youtube.com/watch?v=PLXmPgN6wVs so that you can be aware of the security implications of deploying on Linux/MIPS.
iirc, mips are still used within csco routers ? there used to be a book called “see mips run” that i have used for hacking around in mips asm. quite good too (fwiw).
If you read ‘seem MIPS run’, make sure it’s the 32-bit version. The 64-bit version has a huge number of errors in it.
That said, even at my most cranky, MIPS assembly is not something I would ever inflict on someone, no matter how much they’d annoyed me. Between the lack of useful addressing modes, the inconsistent register naming (what is $t0? Depends on the assembler you’re using!), the huge number of pseudos that most MIPS assemblers make look like normal instructions but that will clobber $at, the magic of $25 in PIC modes, branch delay slots, and the exciting logic in the assembler for either letting you fill delay slots, padding them with nops, or trying to fill them from one of your instructions depending on the mode, it’s an awful experience.
I’m not really a fan of RISC-V, but RISC-V manages to copy MIPS while avoiding the most awful parts of MIPS. If you want to learn a simple RISC assembly language, RISC-V is a better choice than MIPS. If you want to learn assembly language for a well-designed ISA, learn AArch64. If you want to learn assembly language that’s a joy to write, learn AArch32 (things like stm and ldm, predication, and the fact that $pc is a general-purpose register are great to use for assembly programmers, difficult to use for compilers, and awful to implement).
There’s an implicit “RISC-V is not a well-designed ISA” there.
Could you elaborate what issue do you see with RISC-V?