Purpose: To understand how parameters are passed in both ways through subroutines.
Problem
Memory locations 31H onwards, several pairs of random integers are stored. e number of pairs is available
in location 30H. Develop a program to fi nd the sum of the numbers obtained by multiplying these pairs.
Multiplications are to be performed without using the MUL instruction of MCS-51. Assume that the sum
would never exceed 8 bits.
Solution
Fig. 8.9 explains the problem graphically. Here a0, a1, a2, etc. are random integers and sum of the product of
the pairs is to be calculated.
8.12 |SOLVED EXAMPLES
3D
3E
3C
3B
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.