write a MIPS program that calculates d=a*b-a*c without using mult instruction --- just for practicing your MIPS assembly.

  1. • Hint: use loop of additions to replace mult.

• Practice SPIM system calls to input values for a, b and c, as well as printout the value of d.


please help me out in writting this program

Recommended Answers

All 2 Replies

x * y = x + x + ... + x
(y times).

Just put a zero somewhere and use a loop that runs y times adding x each time.

Or in your case, replace x with a, y with b - c.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.