l5_handouts_4up - Announcements ECE 3140/CS 3420 Computer...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 ECE 3140/CS 3420 Computer Organization S i 2009 Spring 2009 Procedures ECE3140/CS3420 Announcements Homework 1 is done – Congratulations on very few CMS problems! • Project 1 Project 1 – Due Tue., Feb 10 at 10:00pm – Don’t wait until the last minute to post to CMS! Problems in convert.s have been fixed You will need and ECE account on amdpool to do the projects for this class ECE3140/CS3420 – Please do this now, not Feb 10! 2 Hennessy and Patterson Read Chapter 1 – 1.1-1.9 • Read Chapter 2 Read Chapter 2 2.1 through 2.14, Skim B.1,B.2, B.10 • Read Appendix B.6 3.1 through 3.2 – MIPS Calling Convention Document (website) ECE3140/CS3420 MIPS Calling Convention Document (website) Read (for Tuesday) Appendix B.1-B.5 – Notes on Programming in C (website) 3 Procedure Calls & Returns Procedure Calls Jump to start main: la $4, s M Numspaces: li $2, 0 lbu $8 0($4) Parameters Register Management Procedure Returns Return from end Return values Register Management jal NumSpaces ori $4,$2,0 jal puts M lbu $8, 0($4) jr $31 M puts: lbu $8, 0($4) jr $31 M ECE3140/CS3420 MIPS support Very little HW support Mostly Convention Caller/Callee Contract li $4, 0 jal exit M exit: syscall M 4
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Memory Layout ECE3140/CS3420 5 Our Stack Frames ECE3140/CS3420 Top of stack 6 Simple Leaf Routine Stack Frame Design • Local Storage: NO - Everything fits in registers • Pad: NO - Not needed ECE3140/CS3420 • Return Address: NO - Leaf Routine • Saved Registers NO - No Saved Regs used • Argument Block: NO - Leaf Routine • Stack Size = 32 words (128 bytes) 7 Leaf Routine with Local Data Stack Frame Design • Local Storage: YES - Local data cannot fit in registers • Pad: NO - Not needed ECE3140/CS3420 8 • Return Address: NO - Leaf Routine • Saved Registers NO - Not needed • Argument Block: NO - Leaf Routine • Stack Size = 32 words (128 bytes)
Image of page 2