Reputation: 27
When,where and why should the mflo statement be used in assembly language?
Upvotes: 1
Views: 4851
Reputation: 4701
MIPS multiplier is a separate unit, and instructions within the unit consume more than other integer instructions. This is why there is a different handling of this unit and results it provides.
Usage of this unit is as follows:
HI
and LO
, when finishedmfhi
and mflo
Note that if results are not ready when you try to read them, the CPU will wait until they arrive.
If you decide to use mul
and div
instructions, you do not need to think about mfhi
and mflo
instructions.
Upvotes: 1
Reputation: 80294
By extrapolation from this document, when you want to access the result of a multiplication or division on a MIPS processor.
Upvotes: 1