Sample Exercises for Quiz 3

SPARC Architecture, Assembly Language Programming, and C (2nd Edition)

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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.

Page1 / 3

Sample Exercises for Quiz 3 - Sample Exercises for Quiz 3...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online