Write an assembly program In MASM assembler to calculate the sum of odd numbers only...

80.2K

Verified Solution

Question

Programming

Write an assembly program In MASM assembler to calculate the sum of odd numbers only stored in a 16-bit integers array.The size of the array is provided in a separate variable. Use the following design:
 

Sum = 0
FOR i = 0 TO SizeOfArray - 1
    IF Arr[i] % 2 = 1
          Sum = Sum +Arr[i]
    END IF
END FOR

Answer & Explanation Solved by verified expert
3.7 Ratings (518 Votes)
Assume that the array starts from the memory Location 500 size of array 5 and the RESULT SUM IS stored at location 0 So We will add the numbers at locations 501    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students