Docsity

Quiz 2 with Answer Key for Machine Dependent Program | ECS 050, Quizzes of Computer Science

Toggle sidebar
bg1
Name: ____Answer Key_____________
ECS 50 Winter 2004 Section 2 Quiz 2 1/30/2004
1. Assume a 32-bit machine and a compiler with aligned on word boundaries, how much
unused bytes between S1 and S2 based on the following code.
struct S {
char C1, C2, C3, C4;
int I;
char C5, C6, C7;
}
struct S S1, S2;
a. 0 byte
b. 1 byte
c. 2 bytes
d. 3 bytes
char = 1 byte
int = 1 word (4 bytes)
Answer: ____B_____
2. In the instruction movl $1, %eax, the addressing mode of the destination operand is
a. register
b. immediate
c. direct
d. indirect
Answer: ____A____

Partial preview of the text

Download Quiz 2 with Answer Key for Machine Dependent Program | ECS 050 and more Quizzes Computer Science in PDF only on Docsity!

Name: ____Answer Key_____________

ECS 50 Winter 2004 Section 2 Quiz 2 1/30/

  1. Assume a 32-bit machine and a compiler with aligned on word boundaries, how much unused bytes between S1 and S2 based on the following code.

struct S { char C1, C2, C3, C4; int I; char C5, C6, C7; }

struct S S1, S2;

a. 0 byte b. 1 byte c. 2 bytes d. 3 bytes

char = 1 byte int = 1 word (4 bytes)

Answer: ____B_____

  1. In the instruction movl $1, %eax, the addressing mode of the destination operand is

a. register b. immediate c. direct d. indirect

Answer: ____A____