This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Sample Exercises for Quiz 3 Sample Exercises for Quiz 3 The Stack, Accessing Stack Variables, One-Dimensional Arrays, Multi-Dimensional Arrays, Structures, Unions [multi-dimensional arrays, structs/unions, and arrays of structs will not be on Quiz 3 but will be on the Midterm] Review the load/store instructions, alignment restrictions, save instruction formula to allocate local variables on the stack. What are some of the reasons why we have to use the runtime Stack for local variables (as opposed to just mapping all local variables to the local registers in the register set window)? Draw what the following local variable definitions would look like on the Stack. Write the appropriate save instruction to allocate these local variables on the Stack. Write SPARC assembly statements to store the initial values in each local variable. Write SPARC assembly statements to access/read and write each local variable (for example, placing each local variable value into %o0 to pass it as a parameter to a function and also to...
View Full Document
This homework help was uploaded on 02/11/2008 for the course CSE 30 taught by Professor Ord during the Winter '08 term at UCSD.
- Winter '08