Microprocessor Pooja Sharma
Objective:
This manual is used to provide an understanding of the 8085 assembly language programming.
Recommended Systems/Software Requirements:
• GNUsim8085 simulator for 8085.
• 8085 microprocessor kit.
Developed By:
Pooja Sharma,
Faculty member,
Computer Science and Information Technology,
April 2021
Microprocessor Pooja Sharma
Nepathya College,
Manigram, Butwal
Experiment Title Date
1. To find One’s complement of 8 bit number
2. To find Two’s complement of 8 bit number
3. To Exchange content of two memory
locations
4. To Add two 8 bit numbers
5. To Subtract two 8 bit numbers
6. To Add two 16 bit number
7. To Subtract 16 bit number
8. Block transfer
9. Multiplication of 8 bit number
10. Division of 8 bit number
11. Sorting array in acending order
12. Sorting array in decending order
13. To find largest number among array
14. To find smallest number among array
15. Introduction to microprocessor kit and To
find complement of 8 bit number using
microprocessor kit
16. To Add two 8 bit number using
microprocessor kit
17. To subtract two 8 bit number using 8085
microprocessor kit
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 1
To complement 8 bit number
Aim : To perform the 8085 assembly language programming to complement number stored in
4400H using GNUsim8085 simulator.
Algorithm:
1. Start program by loading the data in memory location 4400H into accumulator.
2. Complement accumulator.
3. Store data of accumulator at address 4500H.
4. Stop the program.
Program:
LDA 4400H
CMA
STA 4500H
HLT
Sample Input and Output:
INPUT: 08(4400H)
OUTPUT: F7 (4500H)
April 2021
Microprocessor Pooja Sharma
Result: - Thus the program to complement 8 bit data is executed.
Date:
Experiment: 2
To find 2’s complement of 8 bit number
Aim : To perform the 8085 assembly language programming for finding 2’s complement of
number stored in 2050H using GNUsim8085 simulator.
Algorithm:
1. Start program by loading the data in memory location 2050H into accumulator.
2. Complement accumulator.
3. Add one to accumulator.
4. Store data of accumulator at address 3050H.
5. Stop the program.
Program:
LDA 2050H
CMA
ADI 01H
STA 3050H
HLT
Sample Input and Output:
INPUT: 08(2050H)
OUTPUT: F8 (3050H)
April 2021
Microprocessor Pooja Sharma
Result: - Thus the program to find 2’s complement of 8 bit data is executed.
Date:
Experiment: 3
Exchange Numbers of two memory locations
Aim : To perform 8085 assembly language programming for exchanging two numbers stored in
memory location 2000H and 4000H using GNUsim8085 simulator.
Algorithm:
1. Start program by loading the first data of memory location 2000H into accumulator.
2. Move data of accumulator to B register.
3. Load the second data of memory location 4000H into accumulator.
4. Store content of accumulator at address 2000H.
5. Move data of B register to accumulator.
6. Store content of accumulator at address 4000H.
7. Stop the program.
Program:
LDA 2000H
MOV B, A
LDA 4000H
STA 2000H
MOV A,B
STA 4000H
HLT
April 2021
Microprocessor Pooja Sharma
Sample Input and Output:
INPUT: 03H (2000H)
0AH (4000H)
OUTPUT: 0AH (2000H)
03H(4000H)
Result: - Thus the program to add two 8 bit data is executed.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 4
To add two 8 bit numbers stored in memory location.
Aim : To perform 8085 assembly language programming for adding two numbers stored in
memory location 2020H and 2021H using GNUsim8085 simulator.
Algorithm:
1. Start program by loading the first data of memory location 2020H into accumulator.
2. Move data of accumulator to B register.
3. Load the second data of memory location 2021H into accumulator.
4. Add accumulator with content of B register.
5. Store content of accumulator at address 2050H.
6. Stop the program.
Program:
LDA 2020H
MOV B, A
LDA 2021H
ADD B
STA 2050H
HLT
Sample Input and Output:
INPUT: 03H (2020H)
April 2021
Microprocessor Pooja Sharma
0AH (2021H)
OUTPUT: 0DH (2050H)
Result: - Thus the program to add two 8 bit data is executed.
Date:
Experiment: 5
To subtract two 8 bit numbers stored in memory location.
Aim : To perform 8085 assembly language programming for subtracting number stored in
memory location 3020H from 3021H using GNUsim8 085 simulator.
Algorithm:
1. Start program by loading the first data of memory location 3020H into accumulator.
2. Move data of accumulator to B register.
3. Load the second data of memory location 3021H into accumulator.
4. Subtract register B from accumulator.
5. Store content of accumulator at address 3050H.
6. Stop the program.
Program:
LDA 3020H
MOV B, A
LDA 3021H
SUB B
STA 3050H
HLT
Sample Input and Output:
INPUT: 03H (3020H)
April 2021
Microprocessor Pooja Sharma
05H (3021H)
OUTPUT: 02H (3050H)
Result: - Thus the program to subtract two 8 bit data is executed.
Date:
Experiment: 6
To add two 16 bit numbers stored in memory location.
Aim : To perform 8085 assembly language programming for adding two numbers stored in
memory location 2020H and 2021H to 2022H and 2023H using GNUsim8085 simulator.
Algorithm:
1. Start program by loading the Lower part of first data of memory location 2020H into
accumulator.
2. Move data of accumulator to B register.
3. Load the lower part of second data of memory location 2022H into accumulator.
4. Add accumulator with content of B register.
5. Store content of accumulator at address 2050H.
6. Load the higher part of first data of memory location 2021H into accumulator.
7. Move data of accumulator to B register.
8. Load the higher part of second data of memory location 2023H into accumulator.
9. Add accumulator with content of B register and carry.
10. Store content of accumulator at address 2051H.
11. Stop the program.
Program:
LDA 2020H
MOV B, A
LDA 2022H
April 2021
Microprocessor Pooja Sharma
ADD B
STA 2050H
LDA 2021H
MOV B, A
LDA 2023H
ADC B
STA 2051H
HLT
Sample Input and Output:
INPUT: 00H (2020H)
33H (2021H)
22H(2022H)
33H(2023H)
OUTPUT: 22H (2050H)
66H(2051H)
Result: - Thus the program to add two 16 bit data is executed.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 7
To subtract two 16 bit numbers stored in memory location.
Aim : To perform 8085 assembly language programming for subtracting number stored in
memory location 3020H and 3021H from 3022H and 3023H using GNUsim8085 simulator.
Algorithm:
1. Start program by loading the lower part of second data of memory location 3022H into
accumulator.
2. Move data of accumulator to B register.
3. Load the lower part of first data of memory location 2021H into accumulator.
4. Subtract register B from accumulator.
5. Store content of accumulator at address 3050H.
6. Stop the program.
Program:
LDA 3022H
MOV B, A
LDA 3020H
SUB B
STA 3050H
April 2021
Microprocessor Pooja Sharma
LDA 3023H
MOV B, A
LDA 3021H
SBB B
STA 3051H
HLT
Sample Input and Output:
INPUT: 2DH (3020H)
33H (3021H)
2BH(3022H)
33H(3023H)
OUTPUT: 02H (3050H)
00H(3051H)
Result: - Thus the program to subtract two 16 bit data is executed.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 8
Block Transfer
Aim : To perform the 8085 assembly language programming for block transfer from 0005H-
0009H to 000CH-0010H using GNUsim8085 simulator.
Algorithm:
1. Start program by loading HL pair with 0005 H.
2. Load DE pair with 000CH.
3. Set counter C=05
4. Move data from HL=0005H to accumulator
5. Store content of accumulator to DE=000CH.
6. Increment HL pair
7. Increment DE pair
8. Decrement C.
9. Continue step 4 to 8 until C becomes 0
10. Stop the program.
Program:
LXI H, 0005H
LXI D, 000CH
MVI C, 05H
April 2021
Microprocessor Pooja Sharma
Loop: MOV A,M
STAX D
INX H
INX D
DCR C
JNZ Loop
HLT
Sample Input and Output:
INPUT: 08(0005H)
E0(0006H)
02(0007H)
FF(0008H)
09(0009H)
OUTPUT: 08(000CH)
E0(000DH)
02(000EH)
FF(000FH)
09(0010H)
Result: - Thus the program of block transfer is executed.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 9
To multiply two 8 bit numbers stored in memory location.
Aim : To perform 8085 assembly language programming for multiplying number stored in
memory location 2050H and 2051H using GNUsim8085 simulator.
Algorithm:
1. Start program by loading the first data of memory location 2050H (multiplier) into
accumulator.
2. Move data of accumulator to C register.
3. Load the second data of memory location 2051H (multiplicand) into accumulator.
4. Move data of accumulator to D register.
5. Initialize A=0 and B=0
6. Add D to accumulator
7. If carry doesn’t occur decrement C and continue step 6 until C=0
8. If carry occurs increment B, decrement C and continue step 6 until C=0
9. Store value of accumulator to 2052H
10. Move value of B to Accumulator and then transfer to memory 2053H.
11. Stop the program.
Program:
LDA 2050H
MOV C,A
LDA 2051H
MOV D,A
April 2021
Microprocessor Pooja Sharma
MVI A,00H
MVI B,00H
REPEAT: ADD D
JNC FORWARD
INR B
FORWARD: DCR C
JNZ REPEAT
STA 2052H
MOV A, B
STA 2053H
HLT
Sample Input and Output:
INPUT: 03H (2050H)
F2H (2051H)
OUTPUT: D6H (2052H)
02H(2053H)
Result: - Thus the program to multiply two 8 bit data is executed.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 10
To divide 8 bit numbers stored in memory location.
Aim : To perform 8085 assembly language programming for dividing numbers stored in
memory location 2050H by 2051H using GNUsim8085 simulator.
Algorithm:
1. Start program by initializing C (Quotient) as 00H.
2. Load accumulator with content of 2051H(divisor)
3. Move data of accumulator to B register.
4. Load the Data of memory location 2050H (dividend) into accumulator.
5. Increment C and subtract B from accumulator until there is no carry.
6. If carry occurs then restore value of accumulator by adding B to A.
7. Store content of accumulator at address 2053H(remainder).
8. Decrement C and store the value of C to accumulator.
9. Store content of accumulator at
10. Stop the program.
Program:
MVI C, 00H
LDA 2051H
MOV B, A
April 2021
Microprocessor Pooja Sharma
LDA 2050H
REPEAT: INR C
SUB B
JNC REPEAT
ADD B
STA 2053H
DCR C
MOV A, C
STA 2052H
HLT
Sample Input and Output:
INPUT: 08H (2050H)
03H (2051H)
OUTPUT: 02H (2052H)
02H (2053H)
Result: - Thus the program to Divide 8 bit data is executed.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 11
Sorting array in ascending order
Aim : To perform the 8085 assembly language programming to to sort array in ascending order.
Algorithm: write yourself
Program:
Sample Input and Output:
INPUT:
OUTPUT:
Result: - Thus the program is executed to sort aaray in 8085 microprocessor.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 12
Sorting array in Descending order
Aim : To perform the 8085 assembly language programming to sort array in descending order.
Algorithm: write yourself
Program:
Sample Input and Output:
INPUT:
OUTPUT:
Result: - Thus the program is executed to sort array in 8085 microprocessor.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 13
Finding largest number in array
Aim : To perform the 8085 assembly language programming to find largest number in array.
Algorithm: write yourself
Program:
Sample Input and Output:
INPUT:
OUTPUT:
Result: - Thus the program is executed to find largest number in array.
April 2021
Microprocessor Pooja Sharma
Experiment: 14
Finding smallest number in array
Aim : To perform the 8085 assembly language programming to find smallest number in array.
Algorithm: write yourself
Program:
Sample Input and Output:
INPUT:
OUTPUT:
Result: - Thus the program is executed to find smallest number in array.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 15
To complement 8 bit number using 8085 Microprocessor Kit
Aim : To perform the 8085 assembly language programming to complement number stored in
2000H using 8085 microprocessor kit.
Algorithm:
1. Start program by loading the data in memory location 2000H into accumulator.
2. Complement accumulator.
3. Store data of accumulator at address 2050H.
4. Stop the program.
Program:
LDA 2000H
CMA
STA 2050H
HLT
Hexcode:
Memory Hexcode
LDA 2001 3A
Lower bits of 2002 00
address
Higher bits of 2003 20
address
CMA 2004 2F
STA 2005 32
Lower bits of 2006 50
address
April 2021
Microprocessor Pooja Sharma
Higher bits of 2007 20
address
HLT 2008 76
Sample Input and Output:
INPUT: 0D(2000H)
OUTPUT: F2 (2050H)
Result: - Thus the program to complement 8 bit data is executed by using 8085 kit.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 16
To Add two 8 bit numbers using 8085 Microprocessor Kit
Aim : To perform the 8085 assembly language programming for adding two numbers using
8085 microprocessor kit.
Algorithm:
1. Start program by loading the first data 20H into accumulator.
2. Load second data 0DH to B register.
3. Add accumulator with content of B register.
4. Store content of accumulator at address 2050H.
5. Stop the program.
Program:
MVI A, 20H
MVI B, 0DH
ADD B
STA 2050H
HLT
Hexcode:
Memory Hexcode
MVI A 2001 3E
Data 2002 20
MVI B 2003 06
Data 2004 0D
ADD B 2005 88
STA 2006 32
lower bits of 2007 50
address
April 2021
Microprocessor Pooja Sharma
Higher bits of 2008 20
Address
HLT 2009 76
Output:
OUTPUT: 2D (2050H)
Result: - Thus the program to add two 8 bit data is executed by using 8085 kit.
April 2021
Microprocessor Pooja Sharma
Date:
Experiment: 17
To Subtract two 8 bit numbers using 8085 Microprocessor Kit
Aim : To perform the 8085 assembly language programming for subtracting two numbers using
8085 microprocessor kit.
Algorithm:
1. Start program by loading the first data 20H into accumulator.
2. Load second data 0DH to B register.
3. Subtract B from accumulator.
4. Store content of accumulator at address 2050H.
5. Stop the program.
Program:
MVI A, 20H
MVI B, 0DH
SUB B
STA 2050H
HLT
Hexcode:
Memory Hexcode
MVI A 2001 3E
Data 2002 20
MVI B 2003 06
Data 2004 0D
April 2021
Microprocessor Pooja Sharma
SUB B 2005 90
STA 2006 32
lower bits of 2007 50
address
Higher bits of 2008 20
Address
HLT 2009 76
Output:
OUTPUT: 13 (2050H)
Result: - Thus the program to subtract two 8 bit data is executed by using 8085 kit
April 2021