Mult
Listing index
Pb2
Routine:        Norm
Function:       Normalise a floating point number
Called by:      Add, Mult, Recip
Calls:          None
Entry:          64-bit number is from IX+8 to IX+15
Exit:           64-bit number is from IX+8 to IX+15, Multe is adjusted as necessary
Preserved:      C,D,E,H,L,IX,IY


NORM    LD      B,32
NORM1   LD      A,(IX+15)
; Normalise by shifting left and decrementing the exponent until a 1 appears in the Most Significant Place.
        BIT     7,A
        RET     NZ
        SLA     (IX+8) 
        RL      (IX+9)
        RL      (IX+10)
        RL      (IX+11)
        RL      (IX+12)
        RL      (IX+13)
        RL      (IX+14)
        RL      (IX+15)
        LD      A,(MULTE)
        DEC     A
        LD      (MULTE),A
        DJNZ    NORM1
        RET
 
Mult
Listing index
Pb2