FINAL EXAM REVIEW
This Review is subject to change. Your instructor will give a comprehensive review in class
Low Level Programming Concepts and CPU design
Executing a loop.
1. Write a for loop in assembly code that will execute 6 times:
LD E, 00H ; initializes counter to 0
; instructions to do whatever is done in the loop
INC E ; increment E by one
LD A,E ; Load E into A so we can compare
CP 06H ; Compares value in A to 06
JR NZ,LOOP
2. Understand all the memory cycles and t states of assembly instructions studied in class (or similar ones).
Push
Pop
LD
ADD A,B
LD (HL), 7
LD B,(HL)
LD B,7
LD (HL),B
3. Understand the concept of wait states:
Example: if the clock speed of a CPU is 20MHZ and memory read access is 80ns, how will this effect the memory read cycle?
20MHZ speed has a t state speed of 1/20MHZ or 50 ns.
This would require an additional wait state for each memory read.
4. Know the difference between I/O mapped I/O and memory mapped I/O.
I/O mapped I/O has separate instructions for Input and Output
Memory mapped I/O uses the memory instructions for Input and Output.
The Z-80 that we studied in class has separate I/O instructions and thus was I/O mapped I/O; however one can use memory mapped I/O on a chip that is I/O mapped. This was done in the assembly code studied in class. Be sure to study that code
Page 112 and 113 of your notes!!!!!!! You may be required to write a similar program.
5. The programmer of a subroutine is required to PUSH any and all registers that is used on the stack before the code of the routine and POP the registers is reverse order after the code of the routine. Example: If one uses the registers A and D in a procedure, he or she would need to:
PUSH AF
PUSH DE
instructions
POP DE
POP AF
RET
A Call is really a PUSH PC and a JUMP instruction
A RET is really a POP PC
Be sure you understand how all of the above effects the Stack Pointer.
6. Understand how a 20 bit address can be determined with just 16 bit registers as is done in the 8086.
7. Understand the Intel chip assembly instructions that we worked on in lab. Be able to write those small programs.
8. Know the CPU design for 8080 8086 Z80 and Pentium chips.
9. What is the difference between the Z80 and 8080?
a. Extra set of prime registers A’ B’ C” D’ E’ H’L’ F’
b. Extra IX and IY address registers
c. A refresh register R that allows dynamic memory to refresh RAM
d. An interrupt register and will allow interrupt vector addressing.
10. Look at the following code. 7009 is the starting address of the instruction CD0246
7009 CD0246
Assume that the computer has just read all 3 bytes of the call instruction. CD is the opcode for a call instruction. Assume that the stack pointer SP initially has the value BA01.
The CPU is now ready to execute this instruction.
List the values of the PC and SP as the called program is ready to begin and list the top 2 values in the stack.
NOTE: After the instruction is brought in, the PC contains the value 700C which is stored as the top two items of the stack. WHY? And then the PC is loaded with the new value of the called routine 4602 (remember the bytes are reversed).
So the PC contains the value 4602. The SP contains the value B9FF Why? Because the stack will increase by 2 bytes. When a byte is placed on the stack, the address of the top of the stack is decremented by 1 and thus we have the address BA01 decremented by 2 since we are placing 2 bytes on the stack.
7009 CD
700A 02
700B 46
700C (Next instruction)
SUMMARY: PC contains the value 4602 since it points to the subroutine
SP contains the value B9FF
Top two bytes of the stack are: 0C
70
11. Know the 8086 INTEL assembly code written in Lab 12.
12. Understand the control signals in the notes and what takes place (control signals and status bits) in Memory read and Memory write cycles. Be able to tell all that happens in the first 3 clock cycles of both Memory read and memory write.
REMINDER. KNOW THE ASSEBLY CODE on page 112 and 113 and how all those instructions work.
13. Know all the control signals discussed in class.