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.
- ✅ RISC-V instruction parsing and binary conversion
- 🖥️ GUI using
tkinterfor 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
- 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
testcasegenerator()– generates all standard instruction permutationsbonustestcases()– generates all bonus instruction permutations
python assembler.py