Skip to content

r5by/rv32i-assembler

 
 

Repository files navigation

celebi-pkg License: MIT

example

riscv-assembler Documentation

RISC-V Assembly code assembler package. View the full documentation here

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, 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.

Feel free to open an issue or contact me at kayacelebi17@gmail.com with any questions/inquiries.

Installation

The package can be installed using pip:

$ pip install riscv-assembler

If issues arise try:

$ python3 -m pip install riscv-assembler

RV32I modification

Supported instructions can be found in riscv_assembler/data/rv32i.json. During my implementation, I found the following resource links to be very useful.

References

  1. riscv-cheet-sheet
  2. riscv-spec-v2.2
  3. RV32I Base Integer Instruction Set
  4. riscv-calling-conv
  5. riscv-card

About

A simple RISCV assembler that fully supports rv32i for educational purpose.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.8%
  • Assembly 1.2%