This document contains descriptions of various assembly language programs that can be written for the 8085 microprocessor. It provides examples of programs to add two numbers, multiply numbers with and without carry, divide 8-bit numbers, sort numbers in ascending and descending order, and find the largest and smallest number. The document is intended to teach programming in assembly language for the 8085 microprocessor.
4. Program
JIIT-128, Noida
89
2.Writean Assembly Language Program toadd two numbers ;
results contain carry
LXI H, 4500
MOV A, M
INX H
ADD M
JNC LOOP1
INR C
STA4500
MOV A,C
STA4501
HLT
LOOP1
4
5. Program
JIIT-128, Noida
90
2.Writean Assembly Language Program toadd two numbers ;
results contain carry ( writetheprogram using JC)
LXI H, 4500
MOV A, M
INX H
ADD M
JC LOOP 1
JMP LOOP2
LOOP1 INR C
STA4500
MOV A,C
STA4501
HLT
LOOP1
5
6. ADDITION OF TWO 16 – BIT NUMBERS
91
3.T
owritean assembly language program for adding two 16
bitnumbers using 8085 micro processor.
JIIT-128, Noida 6
7. SUM OF DATAS
92
4.T
owritean assembly language program to
calculate thesum of datas using 8085 microprocessor
JIIT-128, Noida 7
8. SUBTRACTION OF TWO 8 BIT NUMBERS
93
5.T
owritea assembly language program for subtracting 2 bit
(8) numbers by using- 8085
JIIT-128, Noida 8
9. SUBTRACTION OF TWO 16 BIT NUMBERS
94
6.T
owritean assembly language program for subtracting two
16 bitnumbers using 8085 microprocessor kit.
JIIT-128, Noida 9
10. Multiplication ;Nocarry
JIIT-128, Noida
95
LDA2000 / / Load multiplicant toaccumulator
MOV B,A/ / Movemultiplicant fromA(acc)to Bregister
LDA2001 / / Load multiplier toaccumulator
MOV C,A/ / Movemultiplier fromAtoC
MVIA,00 / / Load immediate value 00 to a
L:ADDB/ / Add B(multiplier) withA
DCRC/ / DecrementC,it act asa counter
JNZL/ / Jumpto Lif Creaches0
ST
A2010 / / Store result in to memory
HL
T/ / End
10
11. Multiplication ;Withcarry
JIIT-128, Noida
96
7.Writean assembly program tomultiply a number
by 8
MVI C,OO
LXI H,4100
MOV B,M
INX H
MOV A, M
DCR B
LOOP 2 ADD M
JNC
INR C
LOOP 1 DCR B
JNZ
LOOP1
LOOP2
STA4500
HLT
11
13. DIVISION OF TWO 8 – BIT NUMBERS
98
T
owritean assembly language programfor
dividing two 8 bitnumbers using microprocessor
JIIT-128, Noida 13
14. ASCENDING ORDER
99
9. T
owrite a programtosortgiven‘n’ numbersin
ascending order
JIIT-128, Noida 14
15. DESCENDING ORDER
100
10. T
owrite a programtosort given‘n’numbers
in descending order
JIIT-128, Noida 15
16. Largest Number
JIIT-128, Noida
101
Writean Assembly Language Program tofind a
largest number.
LXI H, 4500
MOV A, M
INX H
CMP M
JNC
JMP
LOOP1
LOOP2
LOOP1
LOOP2
STA4500
MOV A,M
STA4500
HLT
16
17. Smallest Number
JIIT-128, Noida
102
Writean Assembly Language Program tofind a
smallest number.
LXI H, 4500
MOV A, M
INX H
CMP M
JC LOOP1
JMP LOOP2
LOOP1
LOOP2
STA4500
MOV A,M
STA4500
HLT
17
18. References
1. Gaonkar, R. S. (1990). Microprocessor Architecture, Programming
and Applications with the 8085. Fifth Edition Prentice Hall PTR.
18