Quiz3.wi09

# Quiz3.wi09 - b Write the appropriate instructions to...

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

Signature __________________ Name_______________ cs30x____ Student ID _________________ Score: Quiz 3 CSE 30 Winter 2009 #1. a) Write the appropriate save instruction to allocate stack space for the following local variables and any padding. short a; char b; unsigned short c; short d; char e; int f; save _________ , ______________________________ , _________ (Use the formula, not an absolute value) b) Write the appropriate unoptimized SPARC assembly instructions using the above local variables. f = a; c = 0xFADE; d = b; e = 'A'; (OVER)

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

View Full Document
#2. a) Write the appropriate save instruction to allocate stack space for the following local variable declaration . int a[7]; save _________ , ______________________________ , _________ (Use the formula, not an absolute value)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b) Write the appropriate instructions to perform the following assignment statements. a[3] = a[5]; ________________________ ________________________ a[4] = a[1]; ________________________ ________________________ int *ptr; /* ptr mapped to %l4 */ ptr = &a[2]; ________________________ ++ptr; /* ptr mapped to %l4 */ ________________________ int d = *ptr; /* d mapped to %l2; ptr to %l4 */ ________________________ *ptr = d; /* d mapped to %l2; ptr to %l4 */ ________________________ #3. Give the equivalent C array expression for the following pointer expression assuming a is defined as an array. a is equivalent to _____________________________ (equivalent array expression)....
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

Quiz3.wi09 - b Write the appropriate instructions to...

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

View Full Document
Ask a homework question - tutors are online