Solve exercise 4 from section 10.6. Since it is underspecified (a 32-bit product normally requires 64-bits, after all), let's clear it up a little. Write mfMult32 as a function macro that returns the product of its two 32-bit parameters.

Write mfMult32L as a function macro that checks its two literal parameters to see if their product will exceed the prescribed 32-bit limit. If so, print a message (at assembly time -- not run time) and return 0. If not, simply return the requested product.

Finally, write mMult32 to multiply its first two parameters and store them in its third parameter. If the destination cannot hold the entire product, print an (assembly time) message to warn the caller of lost 'precision'.

In all applicable cases check for register passing errors an print warnings to the caller.

As always, document any macros you create well!


This assignment is Level 3.5.