Sunteți pe pagina 1din 5

AQuestion #1: Multiple-Choice (30 points; 2 points each)

1. A program that combines object files into an executable program is called a _________.
a. compiler
b. loader
c. linker
d. assembler
2. A device driver would ordinarily be written in . . .
a. machine language
b. assembly language
c. a platform-independent language, such as Java
d. an application-oriented language
3. Which two 32-bit registers are known as extended index registers?
a. SI, DI
b. EAX, EBX
c. ESI, EDI
d. EBP, ESP
4. What is the name of the lowest 8 bits of the EDX register?
a. DL
b. DH
c. DX
d. none of the above
5. How much memory can be addressed in Real-address mode?
a. 640 K
b. 1 MB
c. 16 MB
d. 4 GB
6. How much memory can be addressed in Protected mode?
a. 640 K
b. 1 MB
c. 16 MB
d. 4 GB
7. Which of the following linear addresses matches the segment-offset address 08F0:0200?
a. 09100h
b. 09200h
c. 0AF0h
d. 08F2h

1
8. Segment-offset addressing is used in which processor mode(s)?
a. Protected
b. Virtual-8086
c. Real-address
d. System management
9. Flat addressing is used in which processor mode(s)?
a. Protected
b. Virtual-8086
c. Real-address
d. System management
10. High-speed memory that reduces the frequency of access by the CPU to conventional memory is called
a. local memory
b. cache memory
c. system memory
d. virtual memory
11. If you wanted to find out whether an integer contained an even number of 1 bits, which status flag would be
useful?
a. carry
b. overflow
c. sign
d. parity
12. If a clock oscillates 10 billion times per second, what is the duration of a single clock cycle?
a. 1 nanosecond
b. 1.0 x 10-9 seconds
c. 1.0 x 1010 seconds
d. 1.0 x 10-10 seconds
13. Which language (or virtual machine) uses short mnemonics such as ADD and SUB to identify instructions?
a. conventional machine language
b. ISA-level language
c. assembly language
d. microcode interpreter
14. Which directive identifies the part of a program containing instructions?
a. .DATA
b. .CODE
c. .STACK
d. .PROG
15. List the three primary steps of the instruction execution cycle, in sequential order.
a. fetch, decode, memory write
b. fetch, memory read, execute
c. decode, fetch, execute
d. fetch, decode, execute

2
Question #2: True False (12 points; 2 points each)

1. Adding 0FFh and 05h in an 8-bit register sets the


F
Overflow flag

2. A word (on x86 systems) is 16 bits. T

3. A doubleword (on x86 systems) is 32 bits. T

4. A signed integer stores the sign in the least significant


F
bit (LSB).

5. If an integer's sign bit is 1, the integer is positive. F

6. What is the value of the booloean expression


T
X ∨(Y ∧Z), when X=true, Y=false, and Z=true?

Question #3: Short Answer (12 points; 3 points each)


1. What is the largest signed integer (2's complement format) that may be stored in 32 bits?

2 32 −1 −1

2. What is the order of operations in the expression 6 + 25 * 4?

Multiplication: 25*4=100 then addition 6+100=106

3. What is the range of decimal numbers that may be stored in a 16 bit register using 2's complement format?

− 216 −1 ≤ N ≤ 216 −1 −1

4. In real-address mode, convert the following hexadecimal segment-offset address to a 20-bit physical address:
8AF3:C91D.

89F30+C91D=9784D

3
Question #4: (5 points)
What is the final hexadecimal value of AX when this code executes

TITLE AddSub program

INCLUDE Irvine32.inc
.code
main PROC

mov ax,4000h
mov bx,1000h
mov cx,1500h

sub ax,bx
sub ax,cx
call DumpRegs

exit
main ENDP
END main

ax = 1500h

Question #5: (15 pts, 5 points each)


Perform the following operations:

7658 5ECF16 286B16

+ 0278 + 3CDE16 – 584A16

1 0148 9BAD16 D02116

4
Question #6: (18 points, 3 points each)
Change the following:

1. 5AEE16 to Binary

0101 1010 1110 11102

2. 45568 to Binary
100 101 101 1102

3. 4FED16 to Octal
First convert to binary then to octal:
0100 1111 1110 1101 2 -- 000 100 111 111 101 101 2 0477558

4. 5218 to Decimal
5 × 8 2 + 2 × 8 + 1 = 320 + 16 + 1 = 337

5. 2AB16 to Decimal
2 ×16 2 + 10 ×16 + 11 = 512 + 160 + 11 = 683

6. 44578 to Hexadecimal
First convert to binary then to hexadecimal:
100 100 101 111 2 1001 0010 11112 - 92F16

Question #7: (8 points, 4 points each)


Perform the following calculation in 8-bit 2’s complements arithmetic. Be sure to give the final answer in decimal. In
each case, indicate when arithmetic overflow occurs. Also indicate when a carry out is discarded from the most
significant bit position
1. (-70) + (-65)
Decimal 2's complement Decimal
–(70)
 –(0100 0110)2 1011 1010
+(–(65))
 –(0100 0001)2 1011 1110
1 0111 1010 +122
There is overflow because we added two negative numbers and we got a positive one. There is also
a discarde carry.
2. (63) + (-128)
Decimal 2's complement Decimal
+(63)  +(0011 1111)2 0011 1111
+(–(128))  –(1000 0000)2 1000 0000
1011 1111 -(0100 0001) –65
No overflow and no carry.

S-ar putea să vă placă și