In the third year of the B.Sc. Physics practical program under TANSCHE, it's crucial to grasp how microprocessors work. A significant part of this involves the Microprocessor 8085, which is a popular 8-bit processor. In this experiment, students get to practice basic arithmetic operations.
This blog post will highlight the experiment on finding the the larger number between two numbers / largest number in a data array using the Microprocessor 8085. This hands-on activity helps students dive into the essential features of the 8085 microprocessor, including programming logic and memory functions. By completing this task, you'll develop a clear understanding of how the 8085 processes data and performs arithmetic operations, laying a strong groundwork in microprocessor systems.
Microprocessor 8085 program to find Largest number
Aim:
Write an assembly language program to find the larger number between two numbers / largest number in a data array using microprocessor 8085.
Apparatus required:
Microprocessor 8085 kit, power supply etc
Program:
Larger number between two numbers
Memory address | Machine code | Mnemonics | Operands | Comments |
8000 | 21 | LXI | 8501H | Address of the first number in memory location |
8001 | 01 | |||
8002 | 85 | |||
8003 | 7E | MOV | A, M | Move the number to the accumulator |
8004 | 23 | INX | H | Address of the second number in memory location |
8005 | BE | CMP | M | Compare the numbers |
8006 | D2 | JNC | 800AH | Is it the smallest number in the accumulator? Go to 800A |
8007 | 0A | |||
8008 | 80 | |||
8009 | 7E | MOV | A, M | Move the number to the accumulator |
800A | 32 | STA | 8503H | Store the number in accumulator to 8503H |
800B | 03 | |||
800C | 85 | |||
800D | 76 | HLT | Stop the program |
Example:
2’s complement of 8-bit number
First input location 8501H - 15H
Second input location 8502H - 25H
Result location 8503H - 25H
Youtube demo:
Largest number in a data array
Memory address | Machine code | Mnemonics | Operands | Comments |
8000 | 21 | LXI | 8501H | Address of the LSB of the number |
8001 | 01 | |||
8002 | 85 | |||
8003 | 4E | MOV | C, M | Count register |
8004 | 23 | INX | H | Address of the first number in memory location |
8005 | 7E | MOV | A, M | Move the number to the accumulator |
8006 | 0D | DCR | C | Decrement the count register |
8007 | 23 | INX | H | Address of the next number in memory location |
8008 | BE | CMP | M | Compare this number with the previous number |
8009 | D2 | JNC | 800DH | Is it the smallest number in the accumulator? Go to 800D |
800A | 0D | |||
800B | 80 | |||
800C | 7E | MOV | A, M | Move the number to the accumulator |
800D | 0D | DCR | C | Decrement the count register |
800E | C2 | JNZ | 8007H | Is C non-zero? Go to 8007H |
800F | 07 | |||
8010 | 80 | |||
8011 | 32 | STA | 8450H | Store the result in 8450H |
8012 | 50 | |||
8013 | 84 | |||
8014 | 76 | HLT | Stop the program |
Example:
2’s complement of 16-bit number
Number of data in a array 8500H - 06
First input location 8501H - 15H
Second input location 8502H - 24H
Third input location 8503H - 36H
Fourth input location 8504H - 17H
Fifth input location 8505H - 10H
Sixth input location 8506H - 02H
Result location 8450H - 36H
Youtube demo:
Result:
The assembly programmes for microprocessor 8085 for finding the larger number between two numbers / largest number in a data array were written and executed using the microprocessor 8085 kit.
0 Comments
It's all about friendly conversation here : )
I'd love to hear your thoughts!
Be sure to check back again because I do make every effort to reply to your comments here.
Please do not post your website link here.