0% found this document useful (0 votes)
14 views28 pages

Up File

The document contains a series of assembly language programs for the 8085 microprocessor, focusing on various data manipulation tasks such as moving data blocks, performing arithmetic operations, and checking specific bits. Each program includes the assembly code, assembler output, and execution results. The tasks are structured in a sequential manner, showcasing the capabilities of the 8085 microprocessor in handling different operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views28 pages

Up File

The document contains a series of assembly language programs for the 8085 microprocessor, focusing on various data manipulation tasks such as moving data blocks, performing arithmetic operations, and checking specific bits. Each program includes the assembly code, assembler output, and execution results. The tasks are structured in a sequential manner, showcasing the capabilities of the 8085 microprocessor in handling different operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

DEVI AHILYA VISHWAVIDYALAYA

Internet of Things (5 years IOT)


IV SEMESTER

MICROPROCESSOR
(8085)

SUBMITTED TO: SUBMITTED BY:


INDEX
S. Contents Page Date of
No. No. Submission
1. Write a program in 8085 assembly language
to move data block starting at location 6000 to
location 7000 without overlap. The length of
block is 200.
2. Write a program in 8085 assembly language
to move data block starting at location 6000 to
location 6100. The length of block is 200.
3. Write a program in 8085 assembly language
to add one-byte binary numbers stored from
location 6000 to 6100. Store the result in
location 6200 onwards. Display the result in
address field.
4. Write a program in 8085 assembly language
to add two multi-byte binary number starting
at location 6000 and 6100 and store the result
at location 6200.
5. Write a program in 8085 assembly language
to subtract 16-bit numbers at location 6000
and 6100 and store the result at location 6200.
6. Write a program in 8085 assembly language
to check the fourth bit of a byte stored at
location ‘X’ is a ‘0’ or ‘1’. If ‘0’ store ‘00H’
else store ‘FFH’ at location ‘Y’. Display the
same in AADRESS/DATA field.
7. Write a program in 8085 assembly language
to add N 2- digit BCD numbers store the
result at location 6000 and store the same in
address/data field.
8. Write a program in 8085 assembly language
to find the product of two unsigned binary
numbers stored at location 6000 and 6100
using successive addition and display the
result in address field.
9. Write a program in 8085 assembly language
to find the product of two unsigned binary
numbers stored at location 6000 and 6100 by
shift left and add method and display the
product in address field.
10. Write a program in 8085 assembly language
to divide a 16-bit number at location 6000
and 6100.
Before Execution
After Execution

Q1. Write a program in 8085 assembly language to move data block starting at
location 6000 to location 7000 without overlap. The length of block is 200.

CODE-

1 MVI C, C8H
2 LXI H, 6000H
3 LXI D, 7000H
4 l1: MOV A, M
5 STAX D
6 INX H
7 INX D
8 DCR C
9 JNZ l1
10 HLT

Assembler Output-
1 0E c8 MVI C, C8H
2 21 00 60 LXI H, 6000H
3 11 00 61 LXI D, 7000H
4 7E l1: MOV A, M
5 12 STAX D
6 23 INX H
7 13 INX D
8 0D DCR C
9 C2 08 08 JNZ l1
10 76 HLT
Before Execution
After Execution

Q2. Write a program in 8085 assembly language to move data block starting at
location 6000 to location 6100. The length of block is 200.

CODE-

1 MVI C, C8H
2 LXI H, 6000H
3 LXI D, 6100H
4 l1: MOV A, M
5 STAX D
6 INX H
7 INX D
8 DCR C
9 JNZ l1
10 HLT

Assembler Output-
1 0E c8 MVI C, C8H
2 21 00 60 LXI H, 6000H
3 11 00 61 LXI D, 6100H
4 7E l1: MOV A, M
5 12 STAX D
6 23 INX H
7 13 INX D
8 0D DCR C
9 C2 08 08 JNZ l1
10 76 HLT
Before Execution

After Execution
Q3. Write a program in 8085 assembly language to add one-byte binary numbers stored from
location 6000 to 6100. Store the result in location 6200 onwards. Display the result in address field.

CODE –
1 LXI H, 6000H
2 LXI D, 6200H
3 MOV B, M
4 INX H
5 L1: MOV A, M
6 ADD B
7 MOV B, A
8 STAX D
9 INX D
10 MVI A, 00H
11 ADC A
12 STAX D
13 INZ D
14 INX H
15 MVI A, FFH
16 CMP L
17 JNZ l1
18 HLT
Assembler Output –

1 21 00 60 LXI H, 6000H

2 11 00 62 LXI D, 6200H

3 46 MOV B, M

4 23 INX H

5 7E l1: MOV A, M

6 80 ADD B

7 47 MOV B, A

8 12 STAX D

9 13 INX D

10 3E 00 MVI A, 00H

11 8F ADC A

12 12 STAX D

13 13 INX D

14 23 INX H

15 3E ff MVI A, FFH

16 BD CMP L

17 C2 08 08 JNZ l1

18 76 HLT
Before Execution

After Execution
Q4. Write a program in 8085 assembly language to add two multi-byte binary
number start at location 6000 and 6100 and store the result at location 6200.

CODE -
1 LHLD 6000H
2 MOV B, H
3 MOV C, L
4 LHLD 6100H
5 MOV D, H
6 MOV E, L
7 MOV A, C
8 ADD E
9 MOV C, A
10 MOV A, B
11 ADC D
12 MOV B, A
13 LXI H, 6200H
14 MOV M, C
15 INX H
16 MOV M, B
17 HLT
Assembler Output –

1 2A 00 60 LHLD 6000H
2 44 MOV B, H
3 4D MOV C, L
4 2A 00 61 LHLD 6100H
5 54 MOV D, H
6 5D MOV E, L
7 79 MOV A, C
8 83 ADD E
9 4F MOV C, A
10 78 MOV A, B
11 8A ADC D
12 47 MOV B, A
13 21 00 62 LXI H, 6200H
14 71 MOV M, C
15 23 INX H
16 70 MOV M, B
17 76 HLT
Before Execution

After Execution
Q5. Write a program in 8085 assembly language to subtract 16-bit numbers at
location 6000 and 6100 and store the result at location 6200.

CODE -
1 LHLD 6000H
2 MOV B, H
3 MOV C, L
4 LHLD 6100H
5 MOV D, H
6 MOV E, L
7 MOV A, C
8 SUB E
9 MOV C, A
10 MOV A, B
11 SBB D
12 MOV B, A
13 LXI H, 6200H
14 MOV M, C
15 INX H
16 MOV M, B
17 HLT
Assembler Output –

1 2A 00 60 LHLD 6000H

2 44 MOV B, H

3 4D MOV C, L

4 2A 00 61 LHLD 6100H

5 54 MOV D, H

6 5D MOV E, L

7 79 MOV A, C

8 93 SUB E

9 4F MOV C, A

10 78 MOV A, B

11 9A SBB D

12 47 MOV B, A

13 21 00 62 LXI H, 6200H

14 71 MOV M, C

15 23 INX H

16 70 MOV M, B
17 76 HLT
Before Execution

After Execution
Q6. Write a program in 8085 assembly language to check the fourth bit of a
byte stored at location ‘X’ is a ‘0’ or ‘1’. If ‘0’ store ‘00H’ else store ‘FFH’ at
location ‘Y’. Display the same in AADRESS/DATA field.

CODE –

1 LXI H, 6000H
2 LXI D, 7000H
3 MVI B, 7FH
4 l1: MOV C, M
5 MVI A, 08H
6 ANA C
7 JNZ l2
8 MVI A, 00H
9 STAX D
10 INX H
11 INX D
12 DCR B
13 JNZ l1
14 l2: MVI A, FFH
15 STAX D
16 INX H
17 INX D
18 DCR B
19 JNZ l1
20 HLT
Assembler Output –

1 21 00 60 LXI H, 6000H
2 11 00 70 LXI D, 7000H
3 06 7f MVI B, 7FH
4 4E l1: MOV C, M
5 3E 08 MVI A, 08H
6 A1 ANA C
7 C2 18 08 JNZ l2
8 3E 00 MVI A, 00H
9 12 STAX D
10 23 INX H
11 13 INX D
12 05 DCR B
13 C2 08 08 JNZ l1
14 3E ff l2: MVI A, FFH
15 12 STAX D
16 23 INX H
17 13 INX D
18 05 DCR B
19 C2 08 08 JNZ l1
20 76 HLT
Before Execution

After Execution
Q7. Write a program in 8085 assembly language to add N 2- digit BCD
numbers store the result at location 6000 and store the same in address/data
field.

CODE –

1 MVI C, 00H
2 LHLD 6100H
3 MOV A, L
4 ADD H
5 DAA
6 JNC l1
7 INR C
8 l1: STA 6000H
9 MOV A, C
10 STA 6001H
11 HLT

Assembler Output -
1 0E 00 MVI C, 00H
2 2A 00 61 LHLD 6100H
3 7D MOV A, L
4 84 ADD H
5 27 DAA
6 D2 0c 08 JNC l1
7 0C INR C
8 32 00 60 l1: STA 6000H
9 79 MOV A, C
10 32 01 60 STA 6001H
11 76 HLT
Before Execution

After Execution
Q8. Write a program in 8085 assembly language to find the product of two
unsigned binary numbers stored at location 6000 and 6100 using successive
addition and display the result in address field.

CODE –

1 LXI H, 6000H
2 MOV D, M
3 LXI H, 6100H
4 MOV E, M
5 MOV C, D
6 MVI D, 00H
7 LXI H, 0000H
8 l1: DAD D
9 DCR C
10 JNZ l1
11 SHLD 6200H
12 HLT

Assembler Output -
1 21 00 60 LXI H, 6000H
2 56 MOV D, M
3 21 00 61 LXI H, 6100H
4 5E MOV E, M
5 4A MOV C, D
6 16 00 MVI D, 00H
7 21 00 00 LXI H, 0000H
8 19 l1: DAD D
9 0D DCR C
10 C2 0e 08 JNZ l1
11 22 00 62 SHLD 6200H
12 76 HLT
Before Execution

After Execution
Q9. Write a program in 8085 assembly language to find the product of two
unsigned binary numbers stored at location 6000 and 6100 by shift left and add
method and display the product in address field.

CODE –

1 LXI H, 6000H
2 MOV E, M
3 MVI D, 00H
4 INX H
5 MOV A, M
6 MVI C, 08H
7 LXI H, 0000H
8 l1: RRC
9 JNC l2
10 DAD D
11 l2: XCHG
12 DAD H
13 XCHG
14 DCR C
15 JNZ l1
16 SHLD 6200H
17 HLT
Assembler Output –

1 21 00 60 LXI H, 6000H
2 5E MOV E, M
3 16 00 MVI D, 00H
4 23 INX H
5 7E MOV A, M
6 0E 08 MVI C, 08H
7 21 00 00 LXI H, 0000H
8 0F l1: RRC
9 D2 12 08 JNC l2
10 19 DAD D
11 EB l2: XCHG
12 29 DAD H
13 EB XCHG
14 0D DCR C
15 C2 0d 08 JNZ l1
16 22 00 62 SHLD 6200
17 76 HLT
Before Execution

After Execution
Q10. Write a program in 8085 assembly language to divide a 16 bit number at
location 6000 and 6100.

CODE –

1 LHLD 6000H
2 LDA 6100H
3 MOV B, A
4 MVI C, 08H
5 BACK: DAD H
6 MOV A, H
7 SUB B
8 JC NEXT
9 MOV H, A
10 INR L
11 NEXT: DCR C
12 JNZ BACK
13 SHLD 6200H
14 HLT
Assembler Output –

1 2A 00 60 LHLD 6000H
2 3A 00 61 LDA 6100H
3 47 MOV B, A
4 0E 08 MVI C, 08H
5 29 BACK: DAD H
6 7C MOV A, H
7 90 SUB B
8 DA 11 08 JC NEXT
9 67 MOV H, A
10 2C INR L
11 0D NEXT: DCR C
12 C2 09 08 JNZ BACK
13 22 00 62 SHLD 6200H
14 76 HLT

You might also like