← all projects

Stack-Based Language to RISC-V Compiler

November 2024

  • C
  • Compilers
  • RISC-V

Built a compiler in C translating a stack-based language to RISC-V assembly.

  • Hand-written lexer supporting keywords, operators, stack operations, and literals
  • Code generator with virtual register allocation
  • Function calling-convention support (prologue/epilogue, argument passing)
  • Structured control-flow lowering (if/else, while) via generated branch labels

Notes

Add example source-to-assembly translations or a compiler pipeline diagram here.