Eed 3018 Laboratory Experiment 1: Basic Operations in Z80: Preliminary Work
Eed 3018 Laboratory Experiment 1: Basic Operations in Z80: Preliminary Work
EXPERIMENT 1:
Preliminary Work
Download the Laboratory programming guide from the web link of the course:
Read Introduction to Designing Microcomputer Programs, Data-Transfer Instructions, Basic Applications of Arithmetic and Logic
Operation Instructions, Binary Addition and Subtraction sections.
Answer the exercise question below
Exercise : Write an assembly language program to set the contents of the registers as follows : A=0, B=1, C=2, D=3,
E=4, H=5, L=6 (use 8-bit LD instruction to transfer one byte of data each time).
Laboratory Work
Edit the program in the Z80 simulator and then execute it step by step. Execute the program twice with different initial values in
registers D and E (see the tables) each time. Record the results into the tables given in the worksheet.
Address
Machine Code
Assembly Code
Comments
--------------------------------------------------------------------------------------------------------------
0000
0001
0002
0003
0005
0007
0008
7B
82
6F
3E00
CE00
67
76
LD
ADD
LD
LD
ADC
LD
HALT
A, E
A, D
L, A
A, 0
A, 0
H, A
AE
AA+D
LA
A0
A A + 0 + Carry
HA
Stop
What for the given program can be used? Where the result is stored? Give the length of the result in bits.
HALT
HALT