

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
8085 program to find larger of two 8 bit numbers
In this program we will see how to find the larger of two numbers.
Problem Statement
Write 8085 Assembly language program to find the larger number of two 8-bit number store dat location 8000H and 8001H.
Discussion
This checking is done by using the CMP instruction. This instruction is very similar to the SUB instruction. The only difference is that it does not update the value of Accumulator after executing. So after comparing, if the CY flag is set, it means that the first number is smaller, and the second one is larger
Input
First input
Address | Data |
---|---|
. . . | . . . |
8000 | FD |
8001 | 23 |
. . . | . . . |
second input
Address | Data |
---|---|
. . . | . . . |
8000 | 59 |
8001 | 75 |
. . . | . . . |
Flow Diagram
Program
Address | HEX Codes | Label | Mnemonics | Comments |
---|---|---|---|---|
F000 | 21, 00, 80 | LXI H,8000H | Point to the first number | |
F003 | 46 | MOV B,M | Load the first number to B | |
F004 | 23 | INX H | Point to next location | |
F005 | 7E | MOV A,M | Get the second number to A | |
F006 | B8 | CMP B | Compare B with A | |
F007 | D2, 0B, F0 | JNC STORE | Is CY = 0,jump to Store | |
F00A | 78 | MOV A,B | Load A with second number | |
F00B | 32, 50, 80 | STORE | STA 8050H | Store the number into memory |
F00E | 76 | HLT | Terminate the program |
Output
First output
Address | Data |
---|---|
. . . | . . . |
8050 | FD |
. . . | . . . |
Second output
Address | Data |
---|---|
. . . | . . . |
8050 | 75 |
. . . | . . . |
- Related Questions & Answers
- 8085 program to find maximum of two 8 bit numbers
- 8085 Program to Add two 8 Bit numbers
- 8085 Program to Subtract two 8 Bit numbers
- 8085 Program to Divide two 8 Bit numbers
- 8085 program to multiply two 8 bit numbers
- 8085 program to swap two 8-bit numbers
- 8085 program to sum of two 8 bit numbers without carry
- Program to Add two 8 Bit numbers in 8085 Microprocessor
- Program to Subtract two 8 Bit numbers in 8085 Microprocessor
- Program to Divide two 8 Bit numbers in 8085 Microprocessor
- 8085 program to multiply two 8 bit numbers using logical instructions
- 8085 program to subtract two 8-bit numbers with or without borrow
- 8085 program to swap two 8 bit numbers using Direct addressing mode
- 8085 Program to multiply two 8-bit numbers (shift and add method)
- 8051 Program to Divide two 8 Bit numbers
Advertisements