- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

- 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 find average of n numbers

In this program we will see how to find the average of n numbers in a given series.

## Problem Statement

Write 8086 Assembly language program to find the average of n numbers stored in a given series starts from memory offset 501. The size of the series is stored at memory offset 500.

## Discussion

To do this task we are initializing the Source Index (SI) register to the starting address of the series. We are also taking the series size into CL. The CL will be used as counter. To store add we are using AL register. Initially set AL to 0. In each iteration we are taking the number from the memory and add them one by one. After addition we are dividing the number with the size of the series to get the average.

Here we are taking the numbers (CF, 24, 2C, 51, 3E. 45) = 1F3. And average is 53

## Input

Address | Data |
---|---|

… | … |

500 | 06 |

501 | CF |

502 | 24 |

503 | 2C |

504 | 51 |

505 | 3E |

506 | 45 |

… | … |

## Flow Diagram

## Program

## Output

Address | Data |
---|---|

… | … |

600 | 53 |

… | … |

- Related Articles
- 8086 program to generate AP series of n numbers
- 8086 program to generate G.P. series of n numbers
- 8086 program to determine cubes of numbers in an array of n numbers
- 8086 program to determine squares of numbers in an array of n numbers
- 8086 program to determine largest number in an array of n numbers
- PHP program to find the average of the first n natural numbers that are even
- 8086 program to find sum of Even numbers in a given series
- 8086 program to find sum of odd numbers in a given series
- Find the average of first N natural numbers in C++
- 8086 program to multiply two 8-bit numbers
- 8086 program to multiply two 16-bit numbers
- Java program to find the average of given numbers using arrays
- Average of Squares of n Natural Numbers?
- Average of first n even natural numbers?
- Average of first n odd naturals numbers?