Skip to content

ychen306/c2mips

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler that compiles a subset of C to MIPS
What's supported:
  * types:
    * struct,
    * int (4 byte),
    * char (1 byte),
    * pointer (4 byte),
    * array (pointer),
    * string (0 terminated char array)
  * arithmetic operators: +-*/ (including pointer arithmetic)
  * sizeof -- NOTE: due to my impatience and idiocy, `sizeof` only works for expressions. i.e. `sizeof(type_name)` won't work
  * '++' and '--' operators 
  * logical operator: not, and, or
  * function
  * loops - for/while (no do-while)
  * if
  * types 
  * line and block comment
  * builtin (magic) funcitons
    * print_str
    * print_int
    * sbrk

NOTE: It doesn't have a type-checker (yet).

About

A compiler that compiles a subset of C into MIPS assembly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published