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

Material Type: Quiz; Class: Machine Dependent Prog; Subject: Engineering Computer Science; University: University of California - Davis; Term: Winter 2004;

Typology: Quizzes

Pre 2010

Uploaded on 07/30/2009

koofers-user-qvw
koofers-user-qvw 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

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____