|58h||MT$FMUL||floating point multiplication|
|Input||Floating-point registers contain the numbers to be multiplied.|
|Output||Accumulator contains accumulator * operand.|
Performs a floating-point multiply on the BCD registers.
The mantissas are multiplied by repeated addition of the operand mantissa into a temporary 28-digit double-precision mantissa (14 bytes) located in the floating-point work buffer at MTT_WBUF+8, ie. immediately following the stored copy of the operand. The top seven bytes, ie. the most significant 14 digits, are then copied from this register into the accumulator and rounded to 12 digits as for addition above.
To multiply pi (3.14159265359) by -7160, set up the following:
FP_PI: DB 59h,53h,26h,59h,41h,31h ;mantissa DB 0 ;exponent DB 0 ;sign DUMMY_GUARD_BYTE: DB 0 FP_CONST: DB 0,0,0,0,60h,71h ;mantissa DB 3 ;exponent DB 80hand execute the following code (taking advantage of the fact that the operand follows immediately after the accumulator in memory):
LDD #MTT_AMAN+1 ;D -> byte above guard digit LDX #2*SZBCD+1 ;length to move STX UTW_S0: LDX #FP_PI OS UT$CPYB ;copy constants into registers OS MT$FMULThe accumulator will now contain the result of -22493.8033997 and will look like this:
MTT_AMAN: 00 MTT_AMAN+1: 97 MTT_AMAN+2: 39 MTT_AMAN+3: 03 MTT_AMAN+4: 38 MTT_AMAN+5: 49 MTT_AMAN+6: 22 MTB_AEXP: 04 MTB_ASGN: 80The operand is not affected by the operation, so still contains -7160.
|Errors||253 - exponent overflow|