Skip to content

A simple compiler that turns MiniC code, whose grammar is a subset of ISO C, to RISC-V assembly code.

Notifications You must be signed in to change notification settings

Adamink/MiniC2RISCV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniC2RISC-V

This repository implements a simple compiler that turns MiniC code, whose grammar is a subset of ISO C, to RISC-V assembly code.

The code was written by Xiao Wu.

Further updates would be presented on github.

As for the course report, click pdf or md.

Prerequisites

  • Linux
  • Flex, Bison

Installation

  • Clone this repo:

    git clone https://github.com/Adamink/MiniC2RISC-V.git
  • Compile and install: For Linux shell users, type command

    make clean
    make

Run

  • The executable file is g--, to compile a MiniC file, type

    ./g-- example/1.c -o example/1.s

    or simply

    ./g-- example/1.c
  • To run the compiler on examples, type

    make example

About

A simple compiler that turns MiniC code, whose grammar is a subset of ISO C, to RISC-V assembly code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published