a.
b.
ii.
MIDTERM EXAM
I. MULTIPLE CHOICE. Choose the best answer among the choices given. (1 point each)
LD A, 00H
LD B, 01H
LD C, 02H
LD D, 03H
LD HL, 8000H
INC A
ADD A, B
ADD A, C
ADD A, D
LD (HL), A
A. 00H
B. 01H
C. 02H
D. 03H
3. What is the value of C?
A. 00H
B. 01H
C. 02H
D. 03H
4. What is the value of D?
A. 00H
B. 01H
C. 02H
D. 03H
5. What is the value of H?
A. 05H
B. 06H
C. 07H
D. 80H
6. What is the value of L?
A. 00H
B. 01H
C. 02H
D. 03H
7. What will be the value of memory address 8000H?
A. 01H
B. 02H
C. 07H
D. 80H
LD A, 01H
CPL A
INC A
C. FFH
D. FEH
10. What does CPL mean?
A. 1s Complement
B. 2s Complement
C. Negate
D. Compile
LD A, 01H
NEG A
LD B, A
CPL A
INC A
LD C, A
HALT
B. FEH
C. FFH
D. 00H
13. What is the value of C after the execution?
A. 01H
B. FEH
C. FFH
D. 00H
LD HL, 8000H
LD (HL), 01H
INC L
LD (HL), 02H
RL L
LD (HL), 04H
RL L
LD (HL), 08H
HALT
14. What is the content of memory address 8000H after the execution?
A. 01H
B. 02H
C. 04H
D. UNCHANGED
15. What is the content of memory address 8001H after the execution?
A. 01H
B. 02H
C. 04H
D. UNCHANGED
16. What is the content of memory address 8002H after the execution?
A. 01H
B. 02H
C. 04H
D. UNCHANGED
17. What is the content of memory address 8003H after the execution?
A. 02H
B. 04H
C. 08H
D. UNCHANGED
18. What is the content of memory address 8004H after the execution?
A. 02H
B. 04H
C. 08H
D. UNCHANGED
LD A, 01H
OR 06H
LD B, A
AND F7
LD C, A
XOR D7H
LD D, A
HALT
LD A, 01H
START:
INC A
CP 05
JP NZ, START
DEC B
JP NZ, LOOP
HALT
C. 3
D. 4
24. How many times will the program return to START?
A. Never
B. 10
C. 16
D. 20
25. What is the memory address of START?
A. 8002H
B. 8004H
C. 8005H
D. 8006H
26. How many times will the program return to LOOP?
A. Never
B. 3
C. 4
D. 5
27. What is the memory address of LOOP?
A. 8002H
B. 8004H
C. 8005H
D. 8006H
28. How many instructions are there in the Z80 microprocessor?
A. 100
B. 156
C. 157
D. None of the above
29. It is a computer program that reads a program written in one language, which is called the source language,
and translates it in to another language, which is called the target language.
A. Assembler
B. Compiler
C. Executer
D. Linker
30. An example of a 1 byte instruction is
A. LD A, 01H
B. LD B, 01H
C. LD B,C
D. LD HL, 8000H
31. An example of a 2 byte instruction is
A. LD A, 01H
B. LD BC, 8000H
C. LD B,C
D. LD HL, 8000H
B. FALSE
C. MAYBE
D. SOMETIME
41. No two registers such as B and C can be added directly
A. TRUE
B. FALSE
C. MAYBE
D. SOMETIME
42. A register or memory location can be subtracted from the accumulator
A. TRUE
B. FALSE
C. MAYBE
D. SOMETIME
43. CPL B
A. Complements content of B
B. Complements content of A
C. Can not execute
D. Complements A and B
44. NEG
A. 1s Complement
B. 2s Complement
C. 3s Complement
D. Negative A
45. RLC B
A. Rotate value of B
B. Rotate value of B with Carry
C. Rotate value of A
D. Rotate value of A with Carry
46. CP B
A. Copy the contents of a register with the contents of a register or memory location
B. Compare the contents of a register with the contents of a register or
memory location
C. Subtract the contents of a register with the contents of a register or memory
location
D. Compare the contents of a register B with the contents of the accumulator
47. BIT 7, B
A. Check bit 7 in register B
B. Sets bit 7 in register B
C. Clears bit 7 in register B
D. Toggle bit 7 in register B
48. SET 7, B
A. Check bit 7 in register B
B. Sets bit 7 in register B
28H
D. HALT
53. Which is an example of an implied memory addressing
A. LD A, C
B. LD A, (8000H)
C. LD C, (HL)
D. LD C, 01H
54. Which is an example of an immediate memory addressing
A. LD A, C
B. LD A, (8000H)
C. LD C, (HL)
D. LD C, 02H
55. Which is an example of an immediate extended memory addressing
A. LD BC, 9000H
B. LD A, (8000H)
C. LD C, (HL)
D. LD C, 01H
56. Which is an example of an immediate extended memory addressing
A. LD BC, 9000H
B. LD A, (8000H)
C. LD C, (HL)
D. LD C, A
II.
Show the Fetch, Decode Execute Process of the Microprocessor Unit (20 points)
Prepared by:
Checked by: