<< Click to Display Table of Contents >> How to Use the Full 48-Bit Result of a 24x24 Multiply |
Click here to download this example
The full 48-bit result is normally generated, but only the least significant 24-bit result is actually returned. To get the upper 24-bits of the result (which the compiler ignores) it is required to pull thre result directly from the mach register, as follows.
void Multiply24Bit ( int24 VdCmd, int24 VqCmd,
int24 ResultHi,
int24 ResultLo )
{
if ( IsHostServiceRequestEvent(7) )
{
// Lower 24-bit result is in the register
ResultLo = VdCmd * VqCmd;
// Access the upper 24-bits of the result
// directly from the register
// (There is no 48-bit data type)
register_mach mach;
ResultHi = mach;
NOP();
}
else {} // Error recovery code ...
}