Sei sulla pagina 1di 4

LIAQUAT UNIVERSITY OF MEDICAL HEALTH & SCIENCES JAMSHORO

INSTITUTE OF BIO MEDICAL TECHNOLOGY


BS IN BIO-MEDICAL Engineering (5th Term 3rd Year) _________ Batch


LAB.EXPERIMENT # 09




Name: __________________________________ Roll No. _______________
Score: _____________ Signature of Teacher: __________________ Date:___________


FIND LARGER OF TWO NUMBERS PROGRAM IN 8085 MICROPROCESSOR
ASSEMBLY LANGUAGE FOR MAT-980 TRAINER


PERFORMANCE OBJECTIVE:

Upon successful completion of this experiment the student will be able to:
Develop a program in 8085 Microprocessor Assembly language for finding larger
number between numbers for the following requirements:
To place the larger of a contents of memory locations 5000H & 5001H in
memory location 5002H. Assume that the contents of memory locations 5000H
& 5001H are unsigned binary numbers.
Convert the Assembly language program of larger number into Machine language.
Write and run program on MAT980.

EQUIPEMENT:

Feedback Microprocessor Application Trainer Mica master MAT-980.
Feedback power supply 01-100,
Connecting leads.


NOTE:

The power supply requirements of the MAT980 with no connected equipment is
+5V 0.25V D.C at 400mA
Before switch on your trainer please get it checked by the teacher.




DISCUSSION:

To develop a Assembly language program for the larger number between numbers. First we
develop a data map in which all program requirements are mentioned along with addresses and
their contents. After data map, a program operation is developed graphically by using flow chart
technique. Flow chart is then converted into Assembly language program of 8085
microprocessor. At the end Assembly language program is converted into machine language
program through instruction set.

DATA:

5000H = FB
5001H = CD
5002H = Result (FB)

FLOW CHART:






























Start
Initialize HL pall
Get first number
No to HL
lCMPM
Store in M
Move M to A
end
First number
No
Yes second number
PROGRAM:

MACHINE ASSEMBLY
LANGUAGE PROGRAM LANGUAGE PROGRAM
ADDRESS CONTENTS MNEMONICS OPERANDS COMMENTS
4800 21 LXI H , 5000H
Initialize M
4801 00

4802 50

4803 7E MOV A , M
Get first number
4804 23 INX H

4805 BE SCMP M Is second number is
larger
4806 D2 JNC DONE

4807 0A

4808 48

4809 7E MOV A , M Yes, get second
number
480A 23 DONE: INX H

480B 77 MOV M , A
Store result
480C 76 HLT
Halt


PROCEDURE:

1. Turn on the power supply for the MAT 980.
2. Press HALT key to exit from main function.
3. Write data at memory locations through MEM key.
4. Write a program at memory locations 4800H through MEM key.
5. Use SST key to execute program step by step with + key.
6. Use REG and of different registers at each instruction execution.
7. Use MEM keys to view the result at memory location 5002H.

TEST RESULT:

(i) What will be the contents of accumulator after comparing the first number with
second number.

Accumulator

(ii) After the execution of first INC H instruction, what will be the contents of HL pair

Register H Register L
(iii) Fill the following memory location after the whole program execution. If first number
is FC and second number is DB.

MEM 5002H

(iv) By using REG & MEM function keys, Fill the following registers & memory location
after end of the execution.

Accumulator Register HL MEM5002H


REVIEW QUESTIONS:

1. What is the purpose of a program?
____________________________________________________________________
____________________________________________________________________

2. What is the role of CMP M instruction in the program?
____________________________________________________________________
____________________________________________________________________

3. Why INC instruction is used in program?
____________________________________________________________________
____________________________________________________________________

4. In which register the largest number is placed in program?
____________________________________________________________________
____________________________________________________________________

5. What is the purpose of MOV M, A instruction?
____________________________________________________________________
____________________________________________________________________

FINAL CHECK LIST:

1. Clean your equipment/material and workbench before you leave.
2. Return all equipment and material to their proper storage area.
3. Submit your answers to questions, together with your data, calculations and result before
the next laboratory.