Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 786 Bytes

README.md

File metadata and controls

45 lines (28 loc) · 786 Bytes

Basic RISC-V Disassembler

A simple RISC-V instruction disassembler written in C.

Features

  • 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

Build

Requires a C compiler (gcc/clang):

gcc -o disasm main.c disasm.c

Usage

./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.bin

Next steps

Add more instruction support

Implement a simple assembler

Extend to full RISC-V emulation

License:

MIT License

Created by Stefan Jipa