Exercise 8085
Exercise 8085
1.
2.
3.
4.
5.
6.
7.
8.
9.
12.
14.
20.
EXERCISE 2:
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
LDA
STA
LDA
STA
LDA
STA
LDA
STA
LDA
STA
2.
3000H
3200H
3001H
3201H
3002H
3202H
3003H
3203H
3004H
3204H
MOV
MOV
MOV
MOV
MOV
MOV
B,H
C,L
H,D
L,E
D,B
E,C
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.
LDA 2100H
RAL
RAL
RAL
RAL
STA 2101H
4.
MVI A,3AH
ADI 48H
STA 2100H
5.
MOV A,E
SUB D
MOV C,A
6.
MOV
ANA
ANA
STA
MOV
ORA
ORA
STA
MOV
XRA
A,B
C
E
3000H
A,B
C
E
3001H
A,B
C
4
XRA E
STA 3002H
7.
Write a program that store 00H into memory location 2500H through
2510H.
MVI
LXI
LOC:MVI
INX
DCR
JNZ
8.
B,10H
H,2500H
M,00H
H
B
LOC
MVI A,NO1
MVI B,NO2
MVI C,00H
ADD B
JNC LOC
INR C
LOC:MOV L,A
MOV H,C
9.
DAD B
DAD D
XCHG
10. Develop a program in assembly that subtracts the number in the DE
register pair from the number in the HL register. Place the result in
BC register.
MOV
SUB
MOV
MOV
SBB
MOV
A,L
E
B,A
A,H
D
C,A
5
11.
LXI H,3150H
LXI D,3250H
MVI C,10H
LOC:MOV A,M
STAX D
INX H
INX D
DCR C
JNZ LOC
12. Write an 8085 assembly language program, which adds two threebyte numbers. The first number is stored in memory locations 3800H,
3801H & 3802H and the second number is stored in memory location
3803H, 3804H & 3805H. Store the answer in memory locations 3810H
upwards.
LHLD 3800H
XCHG
LHLD 3803H
DAD D
SHLD 3810H
LDA 3802H
MOV B,A
LDA 3805H
ADC B
STA 3812H
13. Write an 8085 assembly language program, which checks the number
in memory location 2800H. If the number is an even number, then put
FF in memory location 2810H, otherwise put 00.
MVI B,FFH
LDA 2800H
RAR
JNC LOC
6
MVI B,00H
LOC:MOV A,B
STA 2810H
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.
LXI
MVI
MVI
MVI
LOC2:CMP
JNZ
INR
LOC1:INX
DCR
JNZ
H,2800H
C,10H
B,00H
A,55H
M
LOC1
B
H
C
LOC2
15. Write an 8085 assembly language program to find the smallest value
between two number in memory location 2800H and 2801. Store the
value in memory location 3000H.
LDA 2800H
MOV B,A
LDA 2801H
CMP B
JM LOC
MOV A,B
LOC:STA 3000H