Skip to content

Complete Overhaul of Package, v2.0.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@kcelebi kcelebi released this 03 Apr 04:14
· 177 commits to main since this release

Initiated a full-system update of the package, re-organizing functionality to make it much more efficient for easily converting RISC-V assembly to machine code. Documentation to be updated soon as it is currently transitioning to GitHub Pages.

There are still a few minor kinks to iron out, namely with correctly implementing jumps and a few pseudo instructions.

The procedure for conversion is now much simpler. Consider base steps:

from riscv_assembler import AssemblyConverter as AC

# initialize conversion object, with printing output mode and as nibbles
convert = AC(output_mode = 'p', nibble_mode = True, hex_mode = False)

# convert instruction provided as string to print output
convert("add x1 x0 x0")

# change output mode to array
convert.output_mode = 'a'

# convert instructions in file to array output, each element is a line
result = convert("test0.s")

# change output mode to file, change nibble mode to False
convert.output_mode = 'f'
convert.nibble_mode = False

# convert instructions in file to text file output and binary file output
convert("test0.s", "result.txt")
convert("test0.s", "result.bin")