Está en la página 1de 11

Microprocessor Lab (EEC 553)

Experiment 1: Write a program using 8085 microprocessor assembly language for


decimal, hexadecimal addition and subtraction of two numbers. Store the result at
memory location 2300H
Apparatus: 8085 kit
Input Data:
Memory location
2200H
2201H

Data
85H
56H

Program:
[a] Add two 8 bit numbers
Memory add.
2000H
2003H
2004H
2005H
Memory add.
2006H
2000H
2009H
2003H

Instruction
LXI H, 2200H
MOV A, M
INX H
ADD
M
Instruction
STA
2300H
LXI H,
2200H
HLT
MOV A, M

Opcode
21 00
7E
23
86
Opcode
32
21 00
00
76
7E

2004H
2005H
2006H
2009H

INX H
SUB M
STA 2300H
HLT

23
96
32
76

00

22
[b] Subtract two 8 bit numbers
23
22

23

Result:
[a] Memory location
2300H
[b]

2300H

Data
DBH
2FH

Microprocessor Lab (EEC 553)


Experiment 2: Write a program using 8085 microprocessor assembly language to find
the largest no in a given array. Store the result at memory location 2300H.
Apparatus: 8085 kit
Input Data:
Memory location
2200H
2201H
2202H

Data
04H ; No of elements in an array
56H
78H

2203H
2204H

23H
55H

Program:

Memory
add.
2000H
2003H
2004H
2005H
2008H
2009H
200CH
200DH
200EH
200FH
2012H
2015H

Instruction
LDA 2200H
MOV C, A
XRA A
LXI H 2201H
CMP M
JNC NEXT
MOV A, M
INX H
DCR C
JNZ AGAIN
STA 2300H
HLT

AGAIN:
NEXT:

Opcode
3A
4F
AF
21
BE
D2
7E
23
0D
C2
32
76

00
01

22
22

0D 20

08 20
00 23

Result:
[a] Memory location

Data

2300H

78H

Microprocessor Lab (EEC 553)


Experiment 3: Write a program using 8085 microprocessor assembly language to find
the smallest no in a given array. Store the result at memory location 2300H.
Apparatus: 8085 kit
Input Data:
Memory location
2200H
2201H
2202H
2203H
2204H
Program:

Data
04H ; No of elements in an array
56H
78H
23H
55H

Memory
add.
2000H
2003H
2004H
2006H
2009H
200AH
200DH
200EH
200FH
2010H
2013H
2016H

Instruction
LDA 2200H
MOV C, A
MVI A, FF H
LXI H 2201H
CMP M
JC NEXT
MOV A, M
INX H
DCR C
JNZ AGAIN
STA 2300H
HLT

AGAIN:
NEXT:

Opcode
3A 00
4F

22

21 01 22
BE
DA 0E 20
7E
23
0D
C2 09 20
32 00 23
76

Result:
[a] Memory location

Data

2300H

23H

Microprocessor Lab (EEC 553)


Experiment 4: Write a program using 8085 microprocessor assembly language to
arrange the given array in ascending order.
Apparatus: 8085 kit
Input Data:
Memory location
2200H
2201H
2202H
2203H
2204H

Data
04H ; No of elements in an array
16H
78H
03H
55H

Program:
Memory
add.
2000H
2003H
2004H
2005H
2008H

Instruction

START:

LDA 2200H
MOV B, A
DCR B
LXI H 2200H
MOV C, M

Opcode
3A 00 22
47
05
21 01 22
4E

2009H
200AH
200BH
200CH
200DH
200EH
2011H
2012H
2013H
2014H
2015H
2016H
2017H
201AH
201BH
201EH

DCR C
INX H
MOV A, M
INX H
CMP M
JC NEXT
MOV D, M
MOV M, A
DCX H
MOV M, D
INX H
DCR C
JNZ AGAIN
DCR B
JNZ START
HLT

AGAIN:

NEXT:

0D
23
7E
23
BE
DA 15 20
56
77
2B
72
23
0D
C2
0B 20
05
C2 05 20
76

Result:
[a] Memory location

Data

2201H
2202H
2203H
2204H

03H
16H
55H
78H

Microprocessor Lab (EEC 553)


Experiment 5: Write a program using 8085 microprocessor assembly language to
arrange the given array in descending order.
Apparatus: 8085 kit
Input Data:
Memory location
2200H
2201H
2202H
2203H
2204H

Data
04H ; No of elements in an array
16H
78H
03H
55H

Program:
Memory
add.
2000H
2003H
2004H
2005H
2008H
2009H

Instruction

START:

LDA 2200H
MOV B, A
DCR B
LXI H 2200H
MOV C, M
DCR C

Opcode
3A 00 22
47
05
21 01 22
4E
0D

200AH
200BH
200CH
200DH
200EH
2011H
2012H
2013H
2014H
2015H
2016H
2017H
201AH
201BH
201EH

INX H
MOV A, M
INX H
CMP M
JNC NEXT
MOV D, M
MOV M, A
DCX H
MOV M, D
INX H
DCR C
JNZ AGAIN
DCR B
JNZ START
HLT

AGAIN:

NEXT:

23
7E
23
BE
D2 15 20
56
77
2B
72
23
0D
C2
0B 20
05
C2 05 20
76

Result:
[a] Memory location

Data

2201H
2202H
2203H
2204H

78H
55H
16H
03H

Microprocessor Lab (EEC 553)


Experiment 6: Write a program using 8085 microprocessor assembly language to find no
of 1s in given data byte. Store the result at 2300H memory location.
Apparatus: 8085 kit
Input Data:
Memory location
2200H

Data
F2H

Program:
Memory add.
2000H
2003H
2005H
2007H
2008H
200BH
200CH
200DH
2010H
2011H

Instruction
LDA 2200H
MVI B, 00H
MVI C, 08H
START:
RAR
JNC SKIP
INR B
SKIP :
DCR C
JNZ START
MOV A, B
STA 2300H

Opcode
3A 00 22
06 00
0E 08
1F
D2 0C 20
04
0D
C2 07 20
78
32 00 23

2014H

HLT

76

Result:
[a] Memory location

Data

2300H

05H

Microprocessor Lab (EEC 553)


Experiment 7: Write a program using 8085 microprocessor assembly language to
calculate the sum of series of even numbers. Store the result at 2300H memory location.
Apparatus: 8085 kit
Input Data:
Memory location
2200H
2201H
2202H
2203H
2204H

Data
04H; Length of list
20H
15H
13H
22H

Program:
Memory
add.
2000H
2003H
2004H
2006H
2009H

Instruction

START:

LDA 2200H
MOV C, A
MVI B, 00H
LXI H, 2201H
MOV A, M

Opcode
3A 00 22
4F
06 00
21 01 22
7E

200AH
200CH
200FH
2010H
2011H
2012H
2013H
2014H
2017H
201AH

ANI 01H
JNZ SKIP
MOV A, B
ADD M
MOV B, A
INX H
DCR C
JNZ START
STA 2300H
HLT

SKIP:

E6 01
C2 12 20
78
86
47
23
0D
C2 09 20
32 00 23
76

Result:
[a] Memory location

Data

2300H

42H

Microprocessor Lab (EEC 553)


Experiment 8: Write a program using 8085 microprocessor assembly language to
convert binary to ASCII Hex code. Store the result at 2300H & 2301H memory location.
Apparatus: 8085 kit
Input Data:
Memory location
2200H

Data
3AH

Program:
Memory add.
2000H
2003H
2006H
2009H
200AH
200BH
200CH
200DH
200EH
200FH
2012H

Instruction
LXI SP, 2600
LXI H, 2200H
LXI D, 2300H
MOV A, M
MOV B, A
RRC
RRC
RRC
RRC
CALL ASCII
STAX D

Opcode
31 00
26
21 00 22
11 00 23
7E
47
0F
0F
0F
0F
CD
12

2013H
2014H
2015H
2018H
2019H

INX D
MOV A, B
CALL ASCII
STAX D
HLT

13
78
CD
12
76

Memory add.
2900H
2902H
2904H
2907H
2909H
290BH

Instruction
ASCII:
ANI OFH
CPI 0AH
JC CODE
ADI 07H
CODE:
ADI 30H
RET

Opcode
E6
0F
FE 0A
DA 09 29
C6 07
C6
30
C9

Result:
[a] Memory location

Data

2300H
2301H

33H
41H

Microprocessor Lab (EEC 553)


Experiment 9: Write a program using 8085 microprocessor assembly language to
multiply two 8 bit numbers and store the result at 2300H & 2301H memory location.
Apparatus: 8085 kit
Input Data:
Memory location
2200H
2202H

Data
3AH
21H

Program: Method 1:
LDA 2200H
LXI H, 2201H

; Second number

MOV B, A

; Counter

MVI C, 00H
XRA A
AGAIN:

ADD M
JNC NEXT
INR C

NEXT:

DCR B
JNZ AGAIN
STA 2301H
MOV A, C
STA 2300H
HLT

Method 2:
LXI SP, STACK
LHLD 2200H
XCHG
CALL MULTIPLY
SHLD 2300H
HLT

MULTIPLY: MOV A, D
MVI D, 00H
LXI H, 0000H
MVI B, 08H
NXTBIT:

RAR
JNC NOADD
DAD D

NOADD:

XCHG
DAD H
XCHG
DCR B
JNZ NXTBIT
RET

Result:
[a] Memory location

Data

2300H
2301H

07H
7AH

Microprocessor Lab (EEC 553)


Experiment 10: Write a program using 8085 microprocessor assembly language to add
& subtract numbers in BCD. Store the result at 2300H & 2301memory locations.
Apparatus: 8085 kit
Input Data:
Memory location
2200H
2201H

Data
09H
02H

Program:
[a] BCD Addition
LXI H, 2200H
MOV A, M
INX H
ADD M
DAA
STA 2300H
HLT
[b] Subtract two 8 bit numbers
LXI H, 2200H

MOV C, M
INX H
MVI A, 99H
SUB C
INR A
ADD M
DAA
STA 2301H
HLT
Result:
Memory location
2300H
2301H

Data
11H; Addition result
07H; Subtraction result

Experiment 11: Write a program using 8085 microprocessor assembly language to


divide 16 bit no. by an 8 bit no. Store the result at 2300H memory location.
Apparatus: 8085 kit
Input Data:

Result:
[a] Memory location

Data

2300H
2301H

07H
7AH

También podría gustarte