cs313-2006-t2-problemset2

cs313-2006-t2-problemset2 - CPSC 313 06W Term 2 Problem Set...

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

View Full Document Right Arrow Icon
CPSC 313 06W Term 2 Problem Set #2 Due: Sunday, January 28, 2006 at 11:59 PM (thirteen-hour grace period) All of your solutions should be turned in on paper. 1. Variables declared in a C program can be stored in either registers or memory, and if in memory accessed in a variety of ways: with positive offsets from the frame pointer register %ebp (as for arguments to a function) with negative offsets from the frame pointer register %ebp (as for local variables in a function) using absolute symbolic addressing (as for global or static variables) The following table details the storage decisions made by the compiler for 4 variables declared in a (hypothetical) C program. Variable name Variable storage class Storage location i Local in register %ecx a Argument in memory 8(%ebp) l Local in memory -4(%ebp) g Global in memory g Assume that there is an additional variable named t which is held in register %esi . Fill in the following table with the assembly language instructions necessary to perform the
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

cs313-2006-t2-problemset2 - CPSC 313 06W Term 2 Problem Set...

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