Docstoc

Programming Assignment Code generator

Document Sample
Programming Assignment Code generator Powered By Docstoc
					Programming Assignment 4
      Code generator


              Md. Zahurul Islam
  Center for Research on Bangla Language
             Processing (CRBLP)
               BRAC University
Outline
   Project Details
   What to do?
   New classes
   Changes on previous program
   Lvalue and Rvalue
   MIPS
Project Details
 Code Generator
     Intel Architecture (X86)
     MIPS Architecture
     Java Virtual Machine (JVM)
     Common Language runtime (CLR)
 Our Target: MIPS Architecture
 SPIM Simulator
What to do?
   Download starter-kit
   Find out what you have to do
   Try to understand our starter-kit
   Take a look on our given solution
   Read MIPS references
     Online references on course website
     Computer architecture book
 Lets start!
New classes
 Codegen.java
   Utility class for code generation
 MIPSVisitor.java
   New visitor class to generate MIPS
    assembly code
Changes on previous program
 Symbol class changes
   getOffset()
   setOffset()
   symOffset
 FunDeclAst changes
   FuncFrameSize
   setFrameSize()
   getFrameSize()
 NameVisitor changes
   cuFrameOffset
   …
Lvalue and Rvalue
 Load (default)
 Store
 Manage it carefully
Closer look
   Prolog
   Epilog
   Variables
   Parameter
   Arguments
   Return value
MIPS
 Stack
   Push
   pop
 Registers
     Arguments
     Frame pointer
     Stack pointer
     Return address
     Return value
Sum Up
   Project Details
   What to Do?
   New classes
   Changes on previous program
   Lvalue and Rvalue
   MIPS

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:11
posted:9/28/2011
language:English
pages:10