
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
8086 Program to Search a Number in a String
In this program we will see how to find a number n from a string (an array of numbers).
Problem Statement
Write 8086 Assembly language program to find a number in a string (an array of numbers). The numbers are stored at memory offset 600 onwards.
Discussion
In this program we are taking only 5 numbers. We are searching the number 25. after successful search the DX register will hold the offset address, and BX register will hold the index of that number.
We are taking each number from that array and then compare it with 25. If the numbers are same, then we will return the address and index.
Input
Address |
Data |
---|---|
… |
… |
600 |
96 |
601 |
12 |
602 |
3E |
603 |
25 |
604 |
5F |
… |
… |
Flow Diagram
Program
Output
Register |
DX |
BX |
---|---|---|
Vaue |
0603 |
0003 |
Advertisements