Quiz3.sp10

Quiz3.sp10 - b) Write the appropriate instructions to...

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

View Full Document Right Arrow Icon
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)
Background image of page 1

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

View Full DocumentRight Arrow Icon
#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)
Background image of page 2
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

This note was uploaded on 08/31/2011 for the course CSE 30 taught by Professor Ord during the Fall '08 term at UCSD.

Page1 / 2

Quiz3.sp10 - b) Write the appropriate instructions to...

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