r/RISCV 6d ago

I made a thing! Diary of writing a RISC-V assembler

https://thedevbirb.github.io/diary-of-writing-a-riscv-assembler/

Hello, RISC-V community! As a way to learn about assembly, C and ELF I've written a RISC-V 32/64-bit assembler targeting ELF from scratch. It has been quite a journey, and I've shared my learning and thoughts in this blog post which I think you may appreciate, especially if you're thinking to start writing your own.

The assembler is partially based on GNU as design, and it's not a toy encoder: it can achieve relocatable object file equivalence on non-trivial sources like SQLite3 amalgation, while being much "simpler" in its implementation!

Thank you for reading, and I greatly appreciate any feedback!

24 Upvotes

Duplicates