You are on page 1of 5

EXPERIMENT NO – 7

AIM: - To write a program to arrange an array of data in ascending order using 8085 instruction set.

APPARATUS REQUIRED: - 8085 Development Kit.

PROCEDURE: - The following steps are required to implement the program:-

1. Enter the numbers at memory location 2501, 2502, and2503.


2. The result is to be stored in the memory location 2501 to2505.
3. Used GOTO Command for Executions.
4. Reset to be used before seeing the result at the location2501.
PROGRAM:-

Memory Machine Label Mnemonics Operands Comments


address codes
2000 21,00,25 LXI H,2500 Address for count.
2003 4E MOV C,M Count for number of passes in
register C.
2004 21,00,25 BACK LXI H, 2500
2007 56 MOV D,M Count for number of comparisons in
register D.
2008 23 INX H
2009 7E MOV A,M Ist number in accumulator

200A 23 LOOP INX H Address of next number


200B 46 MOV B,M Next number in Register B.
200C B8 CMP B Compare next number with previous
greatest number>next number, Go to
AHEAD
200D D2,16,20 JNC AHEAD If previous greatest number>next
(1620) number, Go to AHEAD
2010 2B DCX H
2011 77 MOV M,A Place smaller of the two compared
numbers in memory
2012 78 MOV A,B Place greater of the two numbers in
accumulator.
2013 C3,1820 JMP GO (1820)
2016 2B AHEAD DCX H
2017 70 MOV M,B Place smaller of the two compared
numbers in memory
2018 23 GO INX H
2019 15 DCR D Decrease the count for comparisons.
201A C2,0A,20 JNZ LOOP(200A)
201D 77 MOV M,A Place the greatest number after a
pass in the memory
201E 0D DCR C Decrease the count for passes
201F C2,04,20 JNZ BACK
(2004)
2022 76 HLT Stop

OBSERVATION TABLE:-

Data Insert data


location
2500 05(count)
2501 60
2502 40
2503 50
2504 15
2505 25
RESULT:-

LOCATION RESULT
2501 15
2502 25
2503 40
2504 50
2505 60

PRECAUTIONS:-

1. Enter the opcode/data carefully.


2. Don’t pull out any IC and components from any of the experiment at board.
3. Handle all test equipment’s carefully.
4. In case of electric fire, switch off the main supply then use fire extinguisher.
5. Switch off the kit when not in use.

INDUSTRIAL APPLICATION: -

1. To enhance the capability of assembly language programming for industrial /


research use.
2. Manufacturing the sorted lists in increasing order based on some qualities in
industries.

VIVA QUESTIONS:-

1. Which five instructions in 8086 are used for arithmetic?


2. In 8085 which is called as High order / Low order Register?
3. What is the RST for the TRAP?
4. How many interrupts are there in8085?
5. What are the various registers in8085?
Experiment No: 8

AIM: - To write a program to arrange an array of data in descending order using 8085 instruction set.

APPARATUS REQUIRED: - 8085 Development Kit.

PROCEDURE:-

The following steps are required to implement the program-

1. Enter the numbers at memory location 2501, 2502, and2503.


2. The result is to be stored in the memory location 2501 to2505.
3. Used GOTO Command for Executions.
4. Reset used before see the result at the location2501.

PROGRAM:-

Memory Machine Label Mnemonics Operands Comments


address codes

2000 21,00,25 LXI H,2500 Address for count.

2003 4E MOV C,M Count for number of passes in


register C.

2004 21,00,25 BACK LXI H, 2500

2007 56 MOV D,M Count for number of comparisons in


register D .

2008 23 INX H

2009 7E MOV A,M Ist number in accumulator

200A 23 LOOP INX H Address of next number

200B 46 MOV B,M Next number in Register B.

200C B8 CMP B Compare next number with previous


greatest number>next number, Go to
AHEAD

200D DA,16,20 JC AHEAD If previous greatest number>next


number, Go to AHEAD
(2016)

2010 2B DCX H
2011 77 MOV M,A Place smaller of the two compared
numbers in memory

2012 78 MOV A,B Place greater of the two numbers in


accumulator.

2013 C3,18,20 JMP GO

2016 2B AHEAD DCX H

2017 70 MOV M,B Place smaller of the two compared


numbers in memory

2018 23 GO INX H

2019 15 DCR D Decrease the count for comparisons.

201A C2,0A,20 JNZ LOOP(200A)

201D 77 MOV M,A Place the greatest number after a


pass in the memory

201E 0D DCR C Decrease the count for passes

201F C2,04,20 JNZ BACK(2004)

2022 76 HLT Stop

OBSERVATION TABLE:-

Data Insert data


location
2500 05(count)
2501 60
2502 40
2503 50
2504 15
2505 25

RESULT:-

LOCATION RESULT
2501 60
2502 50
2503 40
2504 25
2505 15
PRECAUTIONS:-

1. Enter the opcode/data carefully.


2. Don’t pull out any IC and components from any of the experiment at board.
3. Handle all test equipment’s carefully.
4. In case of electric fire, switch of the main supply then use fire extinguisher.
5. Switch off the kit when not in use.

INDUSTRIAL APPLICATION: -

1. To enhance the capability of assembly language programming for industrial /


research use.
2. Manufacturing the sorted lists in increasing order based on some qualities in
industries.

VIVA QUESTIONS:-

1. How many bit combinations are there in a byte?

2. Give examples for 8 / 16 / 32 bit Microprocessor.

3. Give an example of one address in microprocessor.

4. What is clock frequency for 8085?

SIGNATURE OF LAB INCHARGE

You might also like