pserey / risc-v-binary-translator

A simple translator for getting the RISC-V assembly instructions from binary or hex machine code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

32 bit RISC-V Binary/Hex Translator

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 interactive l 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')
  • 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

image

Instruction specific bit information table

image image

About

A simple translator for getting the RISC-V assembly instructions from binary or hex machine code.


Languages

Language:Python 100.0%