Skip to content

Python-based RISC-V assembler that converts assembly code into 32-bit machine instructions. Supports labels, and includes both CLI and GUI interfaces.

Notifications You must be signed in to change notification settings

AnveshanK/Assembler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RISC-V Assembler with GUI

A Python-based assembler that converts RISC-V assembly code into 32-bit binary instructions.

This is a Python-based assembler for RISC-V assembly language, featuring both a graphical user interface (GUI) and command-line functionality. It translates RISC-V instructions into 32-bit machine code and supports standard and some extended (BONUS) instructions.

✨ Features

  • ✅ RISC-V instruction parsing and binary conversion
  • 🖥️ GUI using tkinter for code input/output
  • 🧾 Command-line support for scripting or automation
  • 🛠️ Bonus custom instructions (mul, rst, rvrs, halt)
  • ⚠️ Syntax and label validation with helpful error output
  • 📂 File operations: Open, Save, Save As, New
  • 🧪 Testcase auto-generation utilities

🧠 Supported Instruction Types

  • R-type: add, sub, slt, sltu, xor, sll, srl, or, and, mul
  • I-type: lw, addi, sltiu, jalr
  • S-type: sw
  • B-type: beq, bne, blt, bge, bltu, bgeu
  • U-type: lui, auipc
  • J-type: jal
  • BONUS: rst, rvrs, halt

🧪 Testcase Generators

  • testcasegenerator() – generates all standard instruction permutations
  • bonustestcases() – generates all bonus instruction permutations

🚀 Usage

GUI Mode (default):

python assembler.py

About

Python-based RISC-V assembler that converts assembly code into 32-bit machine instructions. Supports labels, and includes both CLI and GUI interfaces.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%