0% found this document useful (0 votes)
12 views

Adit's Micro File

This report details a practical activity on the 8085 microprocessor as part of a lab assignment for a microprocessor-based systems design course. It includes an introduction to the 8085 microprocessor, its features, hardware specifications, and a series of programs demonstrating various functionalities such as data storage, arithmetic operations, and data transfer. The document serves as a comprehensive guide for students to familiarize themselves with the 8085 microprocessor kit and its programming.
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)
12 views

Adit's Micro File

This report details a practical activity on the 8085 microprocessor as part of a lab assignment for a microprocessor-based systems design course. It includes an introduction to the 8085 microprocessor, its features, hardware specifications, and a series of programs demonstrating various functionalities such as data storage, arithmetic operations, and data transfer. The document serves as a comprehensive guide for students to familiarize themselves with the 8085 microprocessor kit and its programming.
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/ 27

A

Practical Activity Report


Submitted for

MICROPROCESSOR-BASED SYSTEMS DESIGN(UCS617)

LAB ASSIGNMENT – 1 (8085)

Submitted by:
(GROUP NO – 3)
NAVPREET SINGH KAPOOR: 101803293
ANSH GARG: 101803295
VINAY CHOUHAN: 101803296
KAJAL GOEL: 101803297

BE Third Year

Submitted to-
Dr. MANJU KHURANA

COMPUTER SCIENCE ENGINEERING DEPARTMENT


TIET, Patiala
INDEX

S. No CONTENT Page No
1. Introduction of 8085-microprocessor kit and steps for execution on 1–3
the kit.
2. Familiarity with 8085-microprocessor kit. 4 – 12
i) Write a program to store 8-bit data into one register and then 4
copy that to all registers.

ii) Write a program for addition of two 8-bit numbers. 5

iii) Write a program to add 8-bit numbers using direct and indirect 6–7
addressing mode.
iv) Write a program to add 16-bit numbers using direct and indirect 8–9
addressing mode.
v) Write a program to 8-bit numbers using carry. (using JNC 10
instruction).
vi) Write a program to find 1’s complement and 2’s complement 11 – 12
of 8-bit number.
3. Write a program for the sum of series of numbers. 13
4. Write a program for data transfer from memory block B1 to memory 14
block B2.
5. Write a program for multiply two 8-bit numbers. 15
6. Write a program to add ten 8-bit numbers. Assume the numbers are 16
stored in 8500-8509. Store the result in 850A and 850B memory
address.
7. Write a program to find the negative numbers in a block of data. 17
8. Write a program to count the number of one's in a number. 18
9. Write a program to arrange numbers in Ascending order. 19
10. Calculate the sum of series of even numbers. 20
11. Write an assembly language program to verify how many bytes are 21
present in a given set, which resembles 10101101 in 8085.
12. Write an assembly language program to find the numbers of even 22
parity in ten consecutive memory locations in 8085.
13. Write an assembly language program to convert a BCD number into 23
its equivalent binary in 8085.
14. Write an assembly language program for exchange the contents of 24
memory location.
15. Write a program to find the largest number in an array of 10 elements. 25
Q1. Introduction of 8085-microprocessor kit and steps for execution on the
kit.

Diagram:

Fig 1: Intel 8085 microprocessor

Description:

The 8085 is a conventional von Neumann design based on the Intel 8080. Unlike the 8080 it
does not multiplex state signals onto the data bus, but the 8-bit data bus is instead multiplexed
with the lower eight bits of the 16-bit address bus to limit the number of pins to 40.It is designed
using NMOS technology. The 8085 incorporates the functions of the 8224 (clock generator)
and the 8228 (system controller) on chip, increasing the level of integration. The 8085 can
accommodate slower memories through externally generated wait states (pin 35, READY),
and has provisions for Direct Memory Access (DMA) using HOLD and HLDA signals (pins
39 and 38).
It is used in washing machines, microwave ovens, mobile phones, etc.

1
Features:

➢ 8085 is developed by INTEL.


➢ 8-bit microprocessor: can accept 8-bit data simultaneously.
➢ Operates on single +5V D.C. supply.
➢ Designed using NMOS technology.
➢ 6200 transistors on a single chip.
➢ It provides on chip clock generator; hence it does not require external clock
generator.
➢ Operates on 3MHz clock frequency.
➢ 8bit multiplexed address/data bus, which reduce the number of pins.
➢ 16address lines, hence it can address 2^16 = 64 K bytes of memory
➢ It generates 8 bit I/O addresses; hence it can access 2^8 = 256 I/O ports.
➢ 5 hardware interrupts i.e., TRAP/RST4.5, RST 7.5, RST 6.5, RST 5.5, and INTR
➢ It provides DMA (Direct memory access).
➢ 40-pin I.C. package fabricated on a single LSI chip.
➢ Clock cycle is 320ns.
➢ 80 basic instructions and 246 opcodes.

Hardware Specifications:

➢ 8-bit data bus

➢ 16-bit address bus, which can address upto 64KB

➢ A 16-bit program counter and a stack pointer

➢ Six 8-bits general purpose registers arranged in pairs: BC, DE, HL

➢ H & L can be used as a data pointer (holds memory address)

➢ Special Purpose Registers:

• Accumulator (user accessible)

• Instruction registers (user not accessible)

• Flag registers consisting of five status flags: Sign status (S), Zero status (Z),
Auxiliary carry status (AC), Parity status (P), Carry status (CS)

➢ Requires +5V supply to operate at 3.2 MHZ single phase clock

2
Steps to run/execute program on 8085 microprocessors:

1. Press Reset
2. Press examine memory
3. Enter starting Address of the program
4. Press Next
5. Enter opcode by subsequently pressing next
6. Press reset (skip in case of registers)
7. Press Go
8. Enter starting address of the program
9. Press EXEC/FILL
10. Press Reset
11. Press Examine Register
12. Enter Output address/register
13. Press Next

3
Q2. Familiarity with 8085-microprocessor kit.

i) Write a program to store 8-bit data into one register and then copy
that to all registers.

CODE MEMORY LOCATION OPCODE

MVI A, 48 8000,8001 3E, 48

MOV B, A 8002 47

MOV C, A 8003 4F

MOV D, A 8004 57

MOV E, A 8005 5F

MOV H, A 8006 67

MOV L, A 8007 6F

RST 5 8008 EF

OUTPUT:
A - 48, B - 48, C - 48, D - 48, E - 48, H - 48, L – 48

4
ii) Write a program for addition of two 8-bit numbers.

CODE MEMORY LOCATION OPCODE

MVI A, 48 8000,8001 3E, 48

MVI B, 48 8002,8003 06, 48

ADD B 8004 80

STA 8500 8005,8006,8007 32, 00, 85

RST 5 8008 EF

OUTPUT:

[8500] – 90

5
iii) Write a program to add 8-bit numbers using direct and indirect
addressing mode.

DIRECT ADDRESSING MODE:

CODE MEMORY LOCATION OPCODE


LDA 8500 8000,8001,8002 3A, 00, 85
MOV B, A 8003 47
LDA 8501 8004,8005,8006 3A, 01, 85
ADD B 8007 80
STA 8502 8008,8009,800A 32, 02, 85
RST 5 800B EF

INPUT:

[ 8500] – 88, [ 8501] – 88

OUTPUT:
[ 8502] – 10

6
INDIRECT ADDRESSING MODE:

CODE MEMORY LOCATION OPCODE


LXI H, 8500 8000,8001,8002 21, 00, 85
MOV A, M 8003 7E
INX H 8004 23
ADD M 8005 86
INX H 8006 23
MOV M, A 8007 77
RST 5 8008 EF

INPUT:

[ 8500] – 88, [ 8501] – 88

OUTPUT:

A – 10

7
iv) Write a program to add 16-bit numbers using direct and indirect
addressing mode.

DIRECT ADDRESSING MODE:

CODE MEMORY LOCATION OPCODE

LHLD 8500 8000,8001,8002 2A, 00, 85

XCHG 8003 EB

LHLD 8502 8004,8005,8006 2A, 02, 85

DAD D 8007 19

SHLD 8504 8008,8009,800A 22, 04, 85

RST 5 800B EF

INPUT:

[ 8500] – 48, [ 8501] – 48, [ 8502] – 48, [ 8503] – 48

OUTPUT:

[ 8504] – 90, [ 8505] – 90

8
INDIRECT ADDRESSING MODE:
CODE MEMORY LOCATION OPCODE
LXI B, 8500 8000,8001,8002 01, 00, 85
LDAX B 8003 0A
MOV D, A 8004 57
INX B 8005 03
LDAX B 8006 0A
ADD D 8007 82
STA 8504 8008,8009,800A 32, 04, 85
INX B 800B 03
LDAX B 800C 0A
MOV D, A 800D 57
INX B 800E 03
LDAX B 800F 0A
ADC D 8010 8A
STA 8505 8011,8012,8013 32, 05, 85
RST 5 8014 EF

INPUT:
[ 8500] – 34, [ 8501] – 48, [ 8502] – 54, [ 8503] – 78

OUTPUT:
[ 8504] – 7C , [ 8505] – CC

9
v) Write a program to 8-bit numbers using carry. (using JNC
instruction).

CODE MEMORY LOCATION OPCODE


MVI C, 00 8000,8001 0E, 00
LXI H, 8500 8002,8003,8004 21, 00, 85
MOV A, M 8005 7E
INX H 8006 23
ADD M 8007 86
JNC Next 8008,8009,800A D2, 0D, 80
INR C 800B 0C
INX H 800C 23
Next: MOV M, A 800D 77
INX H 800E 23
MOV M, C 800F 71
RST 5 8010 EF

INPUT:
[ 8500] – 88, [ 8501] – 88

OUTPUT:
[ 8502] – 10, [ 8503] – 01

10
vi) Write a program to find 1’s complement and 2’s complement of 8-bit
number.

1’s COMPLEMENT:
CODE MEMORY LOCATION OPCODE
LDA 8500H 8000,8001,8002 3A, 00, 85
CMA 8003 2F
STA 8501H 8004,8005,8006 32, 01, 85
RST 5 8007 EF

INPUT:
[8500] – 48

OUTPUT:
[8501 – B7

11
2’s COMPLEMENT
CODE MEMORY LOCATION OPCODE
LDA 8500H 8000,8001,8002 3A, 00, 85
CMA 8003 2F
INR A 8004 3C
STA 8501H 8005,8006,8007 32, 01, 85
RST 5 8008 EF

INPUT:
[8500] – 48

OUTPUT:
[8501] – B8

12
Q3. Write a program for the sum of series of numbers.

CODE MEMORY LOCATION OPCODE


LDA 8500H 8000,8001,8002 3A,00,85
MOV C, A 8003 4F
SUB A 8004 97
LXI H,8501H 8005,8006,8007 21,01,85
Back: ADD M 8008 86
INX H 8009 23
DCR C 800A 0D
JNZ Back 800B,800C,800D C2,08,80
STA 8600H 800E,800F,8010 32,00,86
RST 5 8011 EF

INPUT:

[8500] – 04, [8501] – 9A, [8502] – 52, [8503] – 89, [8504] – 3E

RESULT:

1B3

OUTPUT:

[8600] – B3

13
Q4. Write a program for data transfer from memory block B1 to memory
block B2.

CODE MEMORY LOCATION OPCODE

MVI C, 0AH 8000,8001 0E, 0A

LXI H, 8500H 8002,8003,8004 21, 00, 85

LXI D, 8600H 8005,8006,8007 11, 00, 86

Back: MOV A, M 8008 7E

STAX D 8009 12

INX H 800A 23

INX D 800B 13

DCR C 800C 0D

JNZ Back 800D,800E,800F C2, 08, 80

RST 5 8010 EF

INPUT:

[8500] – 01, [8501] – 02, ……… [8509] – 0A

OUTPUT:

[8600] – 01, [8601] – 02, ……… [8609] – 0A

14
Q5. Write a program for multiply two 8-bit numbers.

CODE MEMORY LOCATION OPCODE


LDA 8500H 8000,8001,8002 3A,00,85

MOV E, A 8003 5F
MVI D, 00 8004,8005 16,00
LDA 8501H 8006,8007,8008 3A,01,85
MOV C, A 8009 4F

LXI H,0000H 800A,800B,800C 21,00,00


Back: DAD D 800D 19
DCR C 800E 0D

JNZ Back 800F,8010,8011 C2,0D,80


SHLD 8600H 8012,8013,8014 22,00,86
RST 5 8015 EF

INPUT:

[8500] – B2, [8501] – 03

RESULT:

B2 + B2 + B2 = 0216H

OUTPUT:

[8600] – 16, [8601] – 02

15
Q6. Write a program to add ten 8-bit numbers. Assume the numbers are
stored in 8500-8509. Store the result in 850A and 850B memory address.

CODE MEMORY LOCATION OPCODE


MVI C, 00 8000,8001 0E,00
MVI B,09 8002,8003 06,09
LXI H, 8500H 8004,8005,8006 21,00,85
MOV A, M 8007 7E
Back: INX H 8008 23
ADD M 8009 86
JNC Next 800A,800B,800C D2,0E,80
INR C 800D 0C
Next: DCR B 800E 05
JNZ Back 800F,8010,8011 C2,08,80
INX H 8012 23
MOV M, A 8013 77
INX H 8014 23
MOV M, C 8015 71
RST 5 8016 EF

INPUT:

[8500] – FF, [8501] – 01, [8502] – 01, [8503] – 01, [8504] – 01, [8505] – 01, [8506] – 01,
[8507] – 01, [8508] – 01, [8509] – 01

OUTPUT:
[850A] – 08, [850B] – 01

16
Q7. Write a program to find the negative numbers in a block of data.

CODE MEMORY LOCATION OPCODE


LDA 8500H 8000,8001,8002 3A,00,85
MOV C, A 8003 4F
MVI B, 00 8004,8005 06,00
LXI H, 8500H 8006,8007,8008 21,01,85
Back: MOV A, M 8009 7E
ANI 80H 800A,800B E6,80
JZ Skip 800C,800D,800E CA,10,80
INR B 800F 04
Skip: INX H 8010 23
DCR C 8011 0D
JNZ Back 8012,8013,8014 C2,09,80
MOV A, B 8015 78
STA 8600H 8016,8017,8018 32,00,86
RST 5 8019 EF

INPUT:

[8500] – 04, [8501] – 56, [8502] – A9, [8503] – 73, [8504] – 82

RESULT:

02

OUTPUT:

[8600] – 02

17
Q8. Write a program to count the number of one's in a number.

CODE MEMORY LOCATION OPCODE

LDA 8500H 8000,8001,8002 3A,00,85

MVI B, 08 8003,8004 06.08

MVI D, 00 8005,8006 16,00

Loop 1: RLC 8007 07

JNC Loop2 8008,8009,800A D2,0C,80

INR D 800B 14

Loop2: DCR B 800C 05

JNZ Loop 1 800D,800E,800F C2,07,80

MOV A, D 8010 7A

STA 8600H 8011,8012,8013 32,00,86

RST 5 8014 EF

INPUT:
[8500] – 25 0010 0101

OUTPUT:

[8600] – 03

18
Q9. Write a program to arrange numbers in Ascending order.

CODE MEMORY LOCATION OPCODE


LXI H, 8500H 8000,8001,8001 21,00,85
MOV C, M 8003 4E
DCR C 8004 0D
Repeat: MOV D, C 8005 51
LXI H, 8501H 8006,8007,8008 21,01,85
Loop: MOV A, M 8009 7E
INX H 800A 23
CMP M 800B BE
JC Skip 800C,800D,800E DA,14,80
MOV B, M 800F 46
MOV M, A 8010 77
DCX H 8011 2B
MOV M, B 8012 70
INX H 8013 23
Skip: DCR D 8014 15
JNZ Loop 8015,8016,8017 C2,09,80
DCR C 8018 0D
JNZ Repeat 8019,801A,801B C2,05,80
RST 5 801C EF

INPUT:

[8500] – 05, [8501] – 05, [8502] – 04, [8503] – 03, [8504] – 02, [8505] – 01

OUTPUT:

[8500] – 05, [8501] – 01, [8502] – 02, [8503] – 03, [8504] – 04, [8505] – 05

19
Q10. Calculate the sum of series of even numbers.

CODE MEMORY LOCATION OPCODE


LDA 8500H 8000, 8001, 8002 3A, 00 ,85
MOV C, A 8003 4F
MVI B, 00 8004, 8005 06, 00
LXI H, 8501H 8006, 8007, 8008 21, 01, 85
Back: MOV A, M 8009 7E
ANI 01 800A, 800B E6, 01
JNZ Skip 800C, 800D, 800E C2, 12, 80
MOV A, B 800F 78
ADD M 8010 86
MOV B, A 8011 47
Skip: INX H 8012 23
DCR C 8013 0D
JNZ Back 8014, 8015, 8016 C2, 09, 80
STA 8600H 8017, 8018, 8019 32, 00, 86
RST 5 801A EF

INPUT:
[8500] – 04, [8501] – 20, [8502] – 15, [8503] – 13, [8504] – 22

OUTPUT:
[8600] - 42

20
Q11. Write an assembly language program to verify how many bytes are
present in a given set, which resembles 10101101 in 8085.

CODE MEMORY LOCATION OPCODE


MVI B, 0A 8000,8001 06, 0A
MVI D, AD 8002,8003 16, AD
MVI C, 00 8004,8005 0E, 00
LXI H, 8500H 8006,8007,8008 21, 00, 85
Back: MOV A, M 8009 7E
CMP D 800A BA
JNZ Next 800B,800C,800D C2, 0F, 80
INR C 800E 0C
Next: INX H 800F 23
DCR B 8010 05
JNZ Back 8011,8012,8013 C2, 09, 80
MOV A, C 8014 79
STA 8600H 8015,8016,8017 32, 00, 86
RST 5 8018 EF

INPUT:

[8500] – AD, [8501] – 01, [8502] – 01, [8503] – 01, [8504] – 01, [8505] – 01,
[8506] – 01, [8507] – 01, [8508] – 01, [8509] – 01

OUTPUT:

[8600] – 01

21
Q12. Write an assembly language program to find the numbers of even
parity in ten consecutive memory locations in 8085.

CODE MEMORY LOCATION OPCODE


MVI B, 0A 8000,8001 06, 0A
MVI C, 00 8002,8003 0E, 00
LXI H, 8500H 8004,8005,8006 21, 00, 85
Back: MOV A, M 8007 7E
ANI FF 8008,8009 E6, FF
JPO Next 800A,800B,800C E2, 0E, 80
INR C 800D 0C
Next: INX H 800E 23
DCR B 800F 05
JNZ Back 8010,8011,8012 C2, 07, 80
MOV A, C 8013 79
STA 8600H 8014,8015,8016 32, 00, 86
RST 5 8017 EF

INPUT:

[8500] – 01, [8501] – 03, [8502] – 01, [8503] – 03, [8504] – 01, [8505] – 03,
[8506] – 01, [8507] – 03, [8508] – 01, [8509] – 03

OUTPUT:

[8600] – 05

22
Q13. Write an assembly language program to convert a BCD number into
its equivalent binary in 8085.

CODE MEMORY LOCATION OPCODE


LDA 8500H 8000,8001,8002 3A, 00,85
MOV B, A 8003 47
ANI 0F 8004,8005 E6, 0F
MOV C, A 8006 4F
MOV A, B 8007 78
ANI F0 8008,8009 E6, F0
RRC 800A 0F
RRC 800B 0F
RRC 800C 0F
RRC 800D 0F
MOV B, A 800E 47
XRA A 800F AF
MVI D, 0A 8010,8011 16, 0A
Sum: ADD D 8012 82
DCR B 8013 05
JNZ Sum 8014,8015,8016 C2, 12, 80
ADD C 8017 81
STA 8600H 8018,8019,801A 32, 00, 86
RST 5 801B EF

INPUT:

[8500] – 67

OUTPUT:

[8600] – 43

23
Q14. Write an assembly language program for exchange the contents of
memory location.

CODE MEMORY LOCATION OPCODE

LDA 8500H 8000,8001,8002 3A, 00, 85

MOV B, A 8003 47

LDA 8600H 8004,8005,8006 3A, 00, 86

STA 8500H 8007,8008,8009 32, 00, 85

MOV A, B 800A 78

STA 8600H 800B,800C,800D 32, 00, 86

RST 5 800E EF

INPUT:
[8500] – 48, [8600] – 88

OUTPUT:
[8500] – 88, [8600] – 48

24
Q15. Write a program to find the largest number in an array of 10 elements.

CODE MEMORY LOCATION OPCODE


MVI B, 09 8000,8001 06, 09
LXI H, 8500H 8002,8003,8004 21, 00, 85
MOV A, M 8005 7E
INX H 8006 23
Back: CMP M 8007 BE
JNC Next 8008,8009,800A D2, 0C, 80
MOV A, M 800B 7E
Next: INX H 800C 23
DCR B 800D 05
JNZ Back 800E, 800F, 8010 C2, 07, 80
STA 850AH 8011, 8012, 8013 32, 0A, 85
RST 5 8014 EF

INPUT:

[8500] – 01, [8501] – 02, ……………. [8509] – 0A

OUTPUT:

[850A] – 0A

25

You might also like