This package contains tools and functions that can convert RISC-V Assembly code to machine code. The whole process is implemented using Python purely for understandability and simplicity, less so for efficiency in computation. These tools can be used to convert given lines of code or whole files to machine code. For conversion, output file types are binary, text files, and printing to console. The supported instruction types are R, I, S, SB, U, and UJ. Almost all standard instructions are supported, most pseudo instructions are also supported (see helper functions about adding pseudo/missing instructions).
Feel free to open an issue or contact me with any questions/inquiries.
The package is designed for Python version >=3.8 and can be installed using pip:
If issues arise try:
There have been issues with the bitstring
bitstring dependency installing incorrectly. If this occurs, you can simply pip install it separately:
The package works through an
AssemblyConverter class. The
AssemblyConverter class contains functions to convert individual lines and whole files from Assembly code to machine code in a variety of output types.
Here's a Quick Start on how to convert a whole assembly (
.s) file to machine code using
All done! Read on to find more ways to use