13 years ago
The answer depends on the details of the 32-bit
machine, but the most obvious solution for
multiplication is to treat each number as if
it were split into two 32-bit parts.
If each symbol below represents a 32-bit part:
E = B*D
F = A*D * 2^32
G = B*C * 2^32
H = A*C * 2^64
This is like performing multiplication "by hand",
except that each digit is base 2^32 rather than
Note that this requires 64-bit addition (which can
easily be simulated on a 32-bit machine) as well
as a "carry bit" to keep track single-bit overflow
from the 32x32 multiplies.
Also note that the multiplication by 2^32 and
2^64 can be implemented by offsetting the value
within the result (ie. a virtual "shift" operation).
There appears to be an implementation for x86 at: