{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

programb35

# programb35 - Microprocessors Applications(UPTU Appendix B...

This preview shows pages 1–2. Sign up to view the full content.

Microprocessors & Applications (UPTU) Appendix B  Explanation : Consider that a block of data of N bytes is present at the source location. Let the number of bytes N = 10 for example. We have to initialize this as count in the CX register. Our task is to find out the average of these 10 bytes. i.e. to find out average of 10 numbers. Average = . We know that the source address is in the SI register. Clear the direction flag. Initially, we will add the N bytes, byte by byte using ADD instruction. Once the addition is compute, result of addition will be stored in register AX. Now, we will divide this sum by number of bytes N to find the average. The result of division i.e. quotient is present in the AL register. Display the result using display routine. For example : Block Data : 01 02 03 04 05 06 07 08 09 0A Sum : 01 + 02 + 03 + 04 + 05 + 06 + 07 + 08 + 09 + 0AH = 37 H average = = = 5 H  Algorithm : Step I : Initialise the data segment. Step II : Initialise SI with source address.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern