A simple RISC-V instruction disassembler written in C.
- Parses and disassembles basic RISC-V 32-bit instructions
- Supports R, I, S, B, U, and J instruction types
- Prints instructions with register aliases (e.g.,
x10->a0) - Reads raw binary files containing RISC-V instructions
Requires a C compiler (gcc/clang):
gcc -o disasm main.c disasm.c./disasm <binary_file>Example:
printf "\x33\x05\xa5\x00\x93\x82\x12\x00\x23\x2a\x55\x00\x63\x04\x05\x00\x37\x34\x00\x00\x6f\x00\x00\x00" > code.bin
./disasm code.binNext steps
Add more instruction support
Implement a simple assembler
Extend to full RISC-V emulation
License:
MIT License
Created by Stefan Jipa