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).
The package can be installed using pip:
If issues arise try:
It is possible that the
bitstring dependency might not install correctly. If this occurs, you can simply pip install it separately:
The package works through an
AssemblyConverter class and a
Toolkit class. The
AssemblyConverter class contains functions to convert whole files and projects from Assembly code to machine code. The Toolkit class contains tools to convert individual lines, apply specific instruction format types, calculate branching immediates, and many other functions.
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