{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Quiz3.sp10

# Quiz3.sp10 - 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 Spring 2010 #1. a) Write the appropriate save instruction to allocate stack space for the following local variables and any padding. char a; unsigned short b; short c; int d; char e; short f; save _________ , ______________________________ , _________ (Use the formula, not an absolute value) b) Write the appropriate unoptimized SPARC assembly instructions using the above local variables. c = f; b = 0xCAFE; d = e; a = '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. short a[10]; 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[7] = a[2]; ________________________ ________________________ a[0] = a[5]; ________________________ ________________________ short *ptr; /* ptr mapped to %l4 */ ptr = &a[3]; ________________________ ++ptr; /* ptr mapped to %l4 */ ________________________ short d = *ptr; /* d mapped to %l2; ptr to %l4 */ ________________________ *ptr = d; /* d mapped to %l2; ptr to %l4 */ ________________________ #3. Give the equivalent C pointer expression for the following array expression assuming a is defined as an array. a[42] is equivalent to _____________________________ (equivalent pointer expression)....
View Full Document

{[ snackBarMessage ]}