57h MT$FDIV floating point division
Input Floating-point dividend in accumulator, divisor in operand.
Output Accumulator contains accumulator / operand.
Description

Performs a floating-point divide on the BCD registers.

The mantissas are divided by repeated subtraction of the operator mantissa from the accumulator mantissa, with the result being built up in a seven-byte temporary mantissa located at MTT_WBUF+8. Once the process is complete, the contents of the register are copied to MTT_AMAN and rounded to 12 digits as with multiplication above.

See also: technical manual > utility system services > floating point numbers

Example To divide the result of -22493.8033997 obtained in the multiplication example above by 0.00654, first set up the divisor as a constant:
    FP_DIVISOR:
        DB      0,0,0,0,40h,65h         ;mantissa
        DB      -3                      ;exponent
        DB      0                       ;sign
then execute the following code:
        LDD     #MTT_OMAN+1             ;target is operand
        LDX     #SZBCD                  ;length of one f.p. number
        STX     UTW_S0:
        LDX     #FP_DIVISOR
        OS      UT$CPYB                 ;copy divisor into operand
        OS      MT$FDIV                 ;and do division
The accumulator will now contain the result -3439419.48008 and will look like this:
    MTT_AMAN:   00
    MTT_AMAN+1: 08
    MTT_AMAN+2: 80
    MTT_AMAN+3: 94
    MTT_AMAN+4: 41
    MTT_AMAN+5: 39
    MTT_AMAN+6: 34
    MTB_AEXP:   06
    MTB_ASGN:   80
Errors 253 - exponent overflow