DOC PREVIEW
CSU CS 453 - Study Guide

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS453 Intro and PA1 1CS453 Lecture Day in the life of a Frag 1Plan for today Day in the life of a Frag– how is instruction selection performed on the body?– how is register allocation performed?– how are the prologue and epilogue added? Instruction selection and register allocationCS453 Lecture Day in the life of a Frag 2PrintSeven testing method public int testing() { System.out.println(7); return 0; }CS453 Lecture Day in the life of a Frag 3PrintSeven testing, instruction selection # ExpCALL # ExpCONST li t36, 7 # push parameter onto stack sw t36, 0($sp) subu $sp, $sp, 4 jal _printint # ExpCONST li t37, 0 #StmMOVE(ExpTEMP(t1), e) move $v0, t37CS453 Lecture Day in the life of a Frag 4SpillAll # ExpCALL # ExpCONST li $t0, 7 sw $t0, -12($fp) lw $t0, -12($fp) # push parameter onto stack sw $t0, 0($sp) subu $sp, $sp, 4 jal _printint # ExpCALL # ExpCONST li t36, 7 # push parameter onto stack sw t36, 0($sp) subu $sp, $sp, 4 jal _printint # ExpCONST li t37, 0 #StmMOVE(ExpTEMP(t1), e) move $v0, t37Before spillAfter spill # ExpCONST li $t0, 0 sw $t0, -16($fp) lw $t0, -16($fp) #StmMOVE(ExpTEMP(t1), e) move $v0, $t0CS453 Intro and PA1 2CS453 Lecture Day in the life of a Frag 5Prologue and Epilogue Prologue .text Foo_testing: Foo_testing_framesize=20 Foo_testing_paramsNregsaves=12 sw $ra, 0($sp) subu $sp, $sp, 4 sw $fp, 0($sp) subu $sp, $sp, 4 addu $fp, $sp, Foo_testing_paramsNregsaves subu $sp, $fp, Foo_testing_framesize ... # spilled instructions for body Epilogue # epilogue done2: lw $ra, -4($fp) move $t0, $fp lw $fp, -8($fp) move $fp, $sp jr


View Full Document

CSU CS 453 - Study Guide

Download Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?