Complete Overhaul of Package, v2.0.0
Pre-release
Pre-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")