Quiz3.sp09

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