Week One Lectures Flashcards

1
Q

Hardware refers to:

A

the tangible physical devices that comprise a computer

system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Software refers to:

A

the instructions that control the hardware.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

“Caching” is:

A

moving information from slower storage to faster storage, where it can be accessed more quickly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A “bus” is:

A

a set of parallel “wires” for transferring a set of electrical signals simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

“vonNeumann architecture” refers to computer architectures that:

A

store programs in memory, and execute them under the control of the instruction execution cycle.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Inside the computer, machine instructions, memory addresses, numbers, characters, etc., are all represented as:

A

electrical signals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In the simple CISC architecture, which register holds:

a. the current machine instruction?
b. the current micro-instruction?

A

a. The Instruction Register (IR).

b. The Control Register.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the first step in the instruction execution cycle?

A

Fetch the instruction at the address in the Instruction Pointer into the Instruction Register.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the second step in the instruction execution cycle?

A

Increment the Instruction Pointer to point to next instruction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the third step in the instruction execution cycle?

A

Decode the instruction in the Instruction Register.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the fourth step in the instruction execution cycle?

A

If the instruction requires memory access, determine the memory address, and fetch the operand from memory into a CPU register, or send the operand from a CPU register to memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the fifth step in the instruction execution cycle?

A

Execute the instruction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the sixth step in the instruction execution cycle?

A

Repeat from step 1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Consider the virtual machine levels. At each level (except 0: Digital Logic and 5: High level language), an interpreter accepts an instruction from the level above, converts the instruction to its own language, and passes the resulting instructions to the level below. Note that Level-0 has no interpreter; the instructions from the Micro-architecture level are sent directly to the hardware.
Suppose that the interpreters at each level (levels 1 - 4) generate n instructions in order to represent one instruction from the level above. Suppose also that each Level-0 instruction executes in c nanoseconds.
a. How long does it take to execute a Level-3 instruction?
b. How long does it take to execute a Level-5 instruction?

A

a. cn^2 ns. Going from level-3 to level-2 creates n instructions. For each of those n instructions, going from level-2 to level-1 creates n instructions, so there will be n^2 micro-instructions, each of which requires c nano-seconds to execute.
b. cn^4 ns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

a. A MASM program must have a procedure named “main.”

b. ‘END main’ is a directive that tells the OS where to begin execution of the program.

A

a. True

b. True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
What's wrong with the following data segment?
.data
x_value DWORD 5
7Eleven BYTE "My job", 0
X_VALUE DWORD 500
Age  ;user's age;   DWORD  ?
A

x_value and X_VALUE are the same variable, since MASM is not case-sensitive.
7Eleven is an invalid variable name (can’t start with a digit).
Age ;user’s age; DWORD ? The first semi-colon makes all of the rest of the line into a comment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q
The following data segment starts at memory address 1400. What is the address of each variable?
.data
a. myName BYTE "Elmer Fudd", 0
b. yourName BYTE 30 DUP(0)
c. myAge DWORD 45
d. yourAGE DWORD ?
e. myScore DWORD ?
f. yourScore DWORD ?
A

a. Address = 1400, size = 11
b. Address = 1400 + 11 = 1411, size = 30
c. Address = 1411+ 30 = 1441, size = 4
d. Address = 1441+ 4 = 1445, size = 4
e. Address = 1445+ 4 = 1449, size = 4
f. Address = 1449+ 4 = 1453, size = 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How many bits in 35 MiB ?

A

35 x 2^20 (Bytes) x 8 (bits per Byte) = 293 601 280 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the width of the internal bus for IA-32 architecture?

A

32 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the size of the general-purpose registers for IA-32 architecture?

A

32 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What’s the result of the following code fragment? I.E., what registers are changed?
mov eax, 100
cdq ; convert double to quad
mov ebx, 13
div ebx

A

Registers changed:
eax contains 7 (integer quotient of 100/13)
ebx contains 13 (assigned, unchanged by division)
edx contains 9 (integer remainder of 100/13)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q
Given the following constant definition and data segment:
MY_CREDITS = 12 
.data
x  DWORD 12
y  DWORD 13
z  WORD 25

What’s wrong with the following code segment statements?

a. mov ebx, z
b. mov y, x
c. mov ebx, MY_CREDITS
d. mov MY_CREDITS, ebx

A

a. Size mismatch
b. Can’t move memory to memory
c. Nothing wrong here
d. Can’t assign register to a constant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q
Given the following data segment:
.data
intro_1 BYTE   "Welcome, "
userName BYTE   "Fred."
intro_2 BYTE   "What's up?"
count DWORD  0
What is displayed by the following code segment statements?
mov edx, OFFSET intro_1 
CALL WriteString
CALL CrLf
mov edx,OFFSET userName 
CALL WriteString
CALL CrLf
mov edx, OFFSET intro_2 
CALL WriteString
CALL CrLf
A

Welcome, Fred.What’s up?
Fred.What’s up?
What’s up?

Each call to WriteString displays memory until a zero is encountered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Which two registers are automatically used by integer multiplication and division instructions?

A

EAX and EDX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Which register is automatically used as a counter for some looping instructions?

A

ECX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Which register is used for referencing the system stack?

A

ESP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Most register instructions (for now) reference:

A

EAX, EBX, ECX, EDX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

There is more than one set of registers for the integer unit.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Is AL a valid 8-bit register reference?

A

Yes, AL refers to the 8 low-order bits of EAX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Is DH a valid 8-bit register reference?

A

Yes, DH refers to the 8 high-order bits of the 16 low-order bits of EDX.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Is SH a valid 8-bit register reference?

A

No, SH is not allowed. This would be ambiguous, because we have ESP, ESI, and SS registers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Is EL a valid 8-bit register reference?

A

No. Can’t divide the ES register.

33
Q

When instructions have multiple operands, which is usually the source and which is the destination? For example:
mov count, ebx

A

destination operand, source operand
Count is the destination and ebx is the source.
We are moving EBX to count.
Op1 CANNOT be a literal.

34
Q

What types of files are produced by the assembler?

A

Object and listing files

35
Q

What types of files are produced by the linker?

A

Executable files

36
Q

Which operating system component reads and executes programs?

A

Loader

37
Q

What are the data types BYTE and SBYTE?

A

8-bit unsigned and signed integers

38
Q

What are the data types WORD and SWORD?

A

16-bit unsigned and signed integers

39
Q

What are the data types DWORD and SDWORD?

A

Doubleword. 32-bit unsigned and signed integers

40
Q

What is the data type FWORD?

A

48-bit integer (Far pointer in protected mode)

41
Q

What is the data type QWORD?

A

Quadword is a 64-bit integer.

42
Q

What does the MOV operand do?

A

It copies data from a source operand to a destination operand. Cannot move memory to memory.

43
Q

What does the ADD operand do?

A

A source operand is added to a destination operand, and the sum is stored in the destination. Operands must be the same size.

44
Q

What does the SUB operand do?

A

Subtracts the source operand from the destination operand. Has two operands.

45
Q

What does the MUL operand do?

A

Multiplies AL, AX, or EAX by a source operand. If the source is 8 bits, it is multiplied by AL and the product is stored in AX. If the source is 16 bits, it is multiplied by AX and the product is stored in DX:AX. If the source is 32 bits, it is multiplied by EAX and the product is stored in EDX:EAX.

46
Q

What does the DIV operand do?

A

Performs either 8-, 16-, or 32-bit unsigned integer division. If the divisor is 8 bits, the dividend is AX, the quotient is AL, and the remainder is AH.

If the divisor is 16 bits, the dividend is DX:AX, the quotient is AX, and the remainder is DX.

If the divisor is 32 bits, the dividend is EDX:EAX, the quotient is EAX, and the remainder is EDX.

47
Q

What does the CDQ operand do?

A

Converts Doubleword to Quadword. Extends the sign bit in EAX throughout the EDX register.

48
Q

What does the JMP operand do?

A

Jump Unconditionally to Label. Jump to a code label. A short jump is within −128 to +127 bytes from the current location. A near jump is within the same code segment, and a far jump is outside the current segment.

49
Q

How many bits are used by Unicode characters in MS-Windows?

A

16

50
Q

What values can a signed byte can be equal to?

A

-128 to 127

51
Q

A program that combines object files into an executable program is called a _________.

A

Linker

52
Q

What is the largest signed integer that may be stored in 32 bits?

A

2^31 - 1

53
Q

What is the name of the time delay in a CPU caused by differences between the speed of the CPU, the system bus, and memory circuits?

A

Wait state

54
Q

If you wanted to find out whether an integer contained an even number of 1 bits, which status flag would be useful?

A

Parity

55
Q

The four parts of a CPU are:

A

clock, registers, control unit, arithmetic logic unit

56
Q

How much memory can be addressed in Real-address mode? Protected mode?

A

1 MB Real-address Mode

4 GB Protected Mode

57
Q

During which phase of the instruction execution cycle is the program counter incremented?

A

Fetch

58
Q

Which internal bus uses binary signals to synchronize actions of all devices attached to the system bus?

A

Control bus

59
Q

List the three primary steps of the instruction execution cycle, in sequential order.

A

Fetch, decode, execute

60
Q

If a clock oscillates 10 billion times per second, what is the duration of a single clock cycle?

A

1.0 X 10^-10 seconds

61
Q

Suppose that you are given the following program. What decimal value does the AX register hold when someProcedure is called??

.data
x DWORD 153461
y BYTE 37
z BYTE 90

.code
main PROC
mov   AH, y
mov   AL, z
call  someProcedure
inc   EAX
mov   EBX, z
xor   EAX, EBX
exit
main ENDP
END MAIN
A

9562.

  1. Convert higher register of AX from 37d to hex = 25h
  2. Convert lower register of AX from 90d to hex = 5Ah
  3. Combine AH + AL = 255Ah
  4. Convert back to decimal = 9562
62
Q

Select a data definition statement that creates an array of 500 signed doublewords named myList and initializes each array element to the value -1.

A

myList SDWORD 500 DUP (-1)

63
Q

Which utility program reads an assembly language source file and produces an object file?

A

Assembler

64
Q

The byte-ordering scheme used by computers to store large integers in memory with the high-order byte at the lowest address is called:

A

Big endian

65
Q

Given the following array definition, what’s a valid constant declaration named ArrayCount that automatically calculates the number of elements in the array?

newArray DWORD 10,20,30,40,50

A

ArrayCount = ($ - newArray) / 4

66
Q

The basic parts of an instruction, in order from left to right, are:

A

label, mnemonic, operand(s), comment

67
Q

When is a directive executed?

When is an instruction executed?

A

a directive is executed at assembly time

an instruction is executed at runtime

68
Q

Which of the following defines a text macro named MESSAGE that contains this string data?

“I’m good at this!”,0

A

MESSAGE TEXTEQU

69
Q

Which directive identifies the part of a program containing instructions?

A

.code

70
Q

The integer range of standard ASCII codes is:

A

0 to 127

71
Q

The three types of buses connected to the CPU are:

A

data, address, control

72
Q

Which flag is set when an unsigned value is too large to fit into a destination operand?

A

carry

73
Q

What is the name of the lowest 8 bits of the EDX register?

A

DL

74
Q

What does a listing file contain?

A

A copy of the program’s source code with line numbers, the numeric address of each instruction, the machine code bytes of each instruction (hex), and program symbols.

75
Q

The following are both valid data definition statements:

List1 BYTE 10,20
BYTE 30,40

A

True

76
Q

The following is a valid data definition statement:

str1 \
BYTE “This string is quite long!”,0

A

True

77
Q

Operands can be?

A
Register name
Constant or constant expression
Variable name (memory)
78
Q

In the AddSub program in Section 3.2, the exit statement calls which predefined MS-Windows function to halt the program?

A

ExitProcess