Professional Documents
Culture Documents
MICROPRESSOR SYSTEM
LAB 2:
Fundamentals of
8085 Instruction
Sets
Objectives:
1) Ability to create simple program instructions
2) Ability to translate between assembly code to machine code
3) Ability to execute and demonstrate the program instructions
4) Ability to analyze the 8085 register and memory map conditions
Equipments :
1. Computer station with Windows OS and MY1 8085 simulation
program
2. 8085 Instruction Sets (Detailed Description)
3. 8085 Instruction Sets (Summarized)
Introduction
The 8085 has 74 basic instructions and 246 total instructions.
The instruction set 8085 was defined by the manufacturer INTEL
CORPORATION. Each 8085 instruction has a one-byte (8-bit)
operation codes or opcode. With 8-bit binary opcode, a total of 256
different operation codes can be generated, each representing a
certain operation
In this, out of the possible 256 opcodes, 246 codes was developed
as 8085 instruction codes.
7 0 7 0
Three-byte opcode
instruction :
low 8 data / address high 8 data / address
7 0 7 0 7
0
An example of a program to be stored in memory is given as follow :
0000
ORG H
2050
LDA H
INR A
2051
STA H
HLT
The machine code (hex code) for this operation will be stored
into the memory with the starting location at 0000H :
2
UniMAP
EKT222 Microprocessor Systems
LABORATORY TASK
Lab1 Q3 review : Write the assembly code that will
a) Add together two data from memory locations 2200H and
2201H
b) Store the result in memory location 2202H
Solution 1 Solution 2
ORG 0000H ORG 0000H
LDA 2200H LXI H,2200H
MOV B,A MOV A,M
LDA 2201H INX H
ADD B ADD M
STA 2202H INX H
HLT MOV M,A
HLT
ADD M 0005H 86
INX H 0006H 23
HLT 0008H 76
3
UniMAP
EKT222 Microprocessor Systems
Assembly Code
DDD/SS
ORG 0000H
S LXI SP,3FF0H ---00RP 0001
B =000
C =001 data16
D
=010
MVI A,05H ---00DD D110 data
M =110 MOV B,A ---01DD DSSS
E =011
H =100 MOV C,B
L =101
A =111 MOV D,C
Reg. MOV E,D
Pairs
BC=00 INR A ---00SS S100
HL=10
DE=01 STA 2050H ---32 addr
SP=11
INR A
LXI H,2051H ---00RP 0001
data16
MOV M,A ---0111 0SSS
LDA 2050H
INR A
INX H ---00RP 0011
MOV M,A
RST 1 ---11XX X111
HLT
Memory Machine Code (Hex)
Location Byte 1 Byte 2 Byte 3
0000H 31 FO 3F
0003H 3E 05
0005H 47
0006H 48
0007H 51
0008H 5A
0009H 3C
000AH 32 50 20
000DH 3C
000EH 21 51 20
0011H 77
0012H 3A 50 20
0015H 3C
0016H 23
0017H 77
0018H C7
0018 76
4
UniMAP
EKT222 Microprocessor Systems
DISCUSSION
1. In Task 1, which solution requires bigger memory size?
Solution 1 requires 12 buyte while solution 2 requires only 9
bytes of memory. Therefore solution 1 requires bigger memory.
2. What can you observe regarding the assembly language
and the machine codes.
Assembly language is using mnemonic while machine codes are
in digital numeric.
3. In Task 2, explain the register conditions and also the
memories 2050H through 2052H when the program
counter reaches :
a. 0008H
B =05
C =05
D =05
E =F9
H =73
L =46
A =05
PC=0008
b. 0011H
1 B =05
2 C =05
3 D =05
4 E =F9
5 H =20
6 L =51
7 A =07
8 PC=0011
c. 0018H
1 B =05
2 C =05
3 D =05
4 E =05
5 H =20
6 L =52
7 A =07
8 PC=0018
4. What does the instruction RST 1 do? How do you derive the
machine code? What will happen if you change the number
1 to another number?
The instruction RST1 do restart the program at 0008H. If the
number 1 changed, the restart address will change to as per the
below table;
Instruction Restart Address
RST 0 0000H
RST 1 0008H
RST 2 0010H
RST 3 0018H
RST 4 0020H
RST 5 0028H
RST 6 0030H
RST 7 0038H
5
300
UniMAP
EKT222 Microprocessor Systems
EXERCISE
1. Using LDA and STA instructions, write a program that will transfer
five byte of memory from location 3000H through 3004H to
location 3200H through 3204H
3. Write a program to swap lower 4 bit nibble with upper 4 bit nibble
of 8 bit data at memory location 2100H and place a result to
location 2101H.
14. Write a program to count the data byte in memory that equal
to 55H starting at memory location 2800H through 280FH. Place
the count value in B register.
7
UniMAP
PDF to Word