ece330_f10_hw7

ece330_f10_hw7 - ECE 330 Due 1 Homework 7 Fall 2010 Provide...

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

View Full Document Right Arrow Icon
ECE 330 Homework 7 Fall 2010 Due: 10/11/2010 Page 1 of 2 1. Provide assembly code for statements a, b and c. typedef unsigned int REGISTER; struct abc { REGISTER a; REGISTER b; REGISTER c; }; char mem[sizeof(struct abc)]; int main() { struct abc *pabc = (struct abc *) ????; unsigned int a = 0x11111111; unsigned int b; pabc->c = a; // a. (*pabc).c = a; // b. b = a; // c. return 0; } 2. What are the resulting values for i, j and k? Which of the statements (a, b or c) are equal. int main() { unsigned char a[] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc}; int *pi = (int *)a; unsigned int i, j, k; i = *pi++; // a. j = (*pi)++; // b. k = *(pi++); // c. return 0; } 3. Complete the following code that results in fp_reg with the current value of the Nios II fp register and r2_req with the current value of the Nios II r2 register. typedef unsigned int REGISTER; int main() { REGISTER fp_reg; REGISTER r2_reg; return 0; }
Background image of page 1

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

View Full DocumentRight Arrow Icon
ECE 330 Homework 7 Fall 2010 Due: 10/11/2010 Page 2 of 2
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/02/2011 for the course ECE 330 at Boise State.

Page1 / 2

ece330_f10_hw7 - ECE 330 Due 1 Homework 7 Fall 2010 Provide...

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