Question: Write an assemby language program that computes three sums: 1 + 2 + 3 + 4 + ... + 99 + 100 1 + 3
Write an assemby language program that computes three sums:
1 + 2 + 3 + 4 + ... + 99 + 100
1 + 3 + 5 + 7 + ... + 97 + 99
2 + 4 + 6 + 8 + ... + 98 + 100
Use a register (say $8) for the sum of evens, a register (say $9) for the sum of odds, and another (say $10) for the sum of all numbers. Do this with one counting loop. The loop body contains logic to add the count to the proper sums.
(Qtspim simulator: The starting address of Data Section is 0x10000000
Mars simulator: The starting address of Data Section may be 0x10010000 (check Settings->Memory Configuration -> .data base address))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
