Microprocessor-Based Systems IFall 2012Exam 2 Solution1. (20 points, 5 points per part) Multiple choiceFor each of the multiple choice questions below, clearly indicate your response by circling orunderlining the single choice you think best answers the question.a. Which of the following statements most accurately describes the role of the LDTR in 80386protected mode?i. ii. | The LDTR directly p
...[Show More]
Microprocessor-Based Systems I
Fall 2012
Exam 2 Solution
1. (20 points, 5 points per part) Multiple choice
For each of the multiple choice questions below, clearly indicate your response by circling or
underlining the single choice you think best answers the question.
a. Which of the following statements most accurately describes the role of the LDTR in 80386
protected mode?
i.
ii. | The LDTR directly provides the base address and limit for the global descriptor table.
The LDTR directly provides the base address and limit for the current local descriptor
table.
The LDTR is a selector that points to a descriptor in the global descriptor table. This
descriptor directly provides the base address and limit for the current local descriptor
table.
The LDTR is a selector that points to a descriptor in the global descriptor table. This
descriptor directly provides the base address and limit for the current data segment.
iii.
iv. v. The LDTR is a selector that points to a descriptor in the current local descriptor table.
This descriptor directly provides the base address and limit for the current data segment.
b. Say you have a high-level program containing an array of short int values, X[30], and
an integer variable, i. If the base address of this array is 31700000H and the value of i is 2,
what is the address of the array element X[i]? Assume short int values hold 16 bits.
i.
ii.
iii.
iv. | 31700000H
31700002H
31700004H
31700008H
2/5 points—didn’t multiply i by size of each element
2/5 points—people who chose this did the right operation but
seemingly ignored that short ints hold 2 bytes, not 4 bytes
2
1 (cont.)
c. Given the conditional statement below:
if (AX == BX)
CX++;
else
CX--;
Which of the following assembly sequences correctly implements this conditional statement?
i. | CMP AX, BX
JE | L1
DEC CX
JMP L2
L1: INC CX
L2: | ; End of statementii. CMP AX, BX
JNE L1
DEC CX
JMP L2
L1: INC CX
L2: ; End of statement
iii. CMP AX, BX
JE L1
DEC CX
L1: INC CX
L2: ; End of statement
iv. CMP AX, BX
JNE L1
DEC CX
L1: INC CX
L2: ; End of statement
[Show Less]