A simple translator for getting 32 bit RISC-V assembly instructions from binary or hex machine code.
As it is an early version, it works as an interactive CLI with a Python script.
- Clone the repository
git clone https://github.com/pserey/risc-v-binary-translator
- Run conv.py
python conv.py
- Choose the the instruction reading mode (
i
for interactivel
for .101 file reading) - If .101 file reading is chosen, type the .101 file address
- If interactive is chosen, you can choose if the given instructions are in binary (b) or hexadecimal (x).
- After that, you can input options that decide if constants in the code are printed as:
- decimal (default =
Enter
) - hexadecimal (
'sx'
) - binary (
'sb'
)
- decimal (default =
- To exit the CLI, input
's'
All the information about binary RISC-V instruction set translation to binary was taken from this paper.
Instruction format table
Instruction specific bit information table