Annotation of cci/sys/tahoe/Ksfnorm.x, revision 1.1

1.1     ! root        1: 
        !             2: #include       "fp.h"
        !             3: #include       "fp_in_krnl.h"
        !             4: 
        !             5: 
        !             6:        .text
        !             7:        .globl  Ksfnorm         # Ksfnorm(hfs)
        !             8: Ksfnorm:       .word   0x007c
        !             9:        clrl    r1
        !            10:        movl    r0,r4           /* copy to temporary. */
        !            11:        jeql    retzero
        !            12:        clrl    r3              /* r3 - pos of m.s.b */
        !            13: inr00: ffs     r4,r6
        !            14:        incl    r6
        !            15:        addl2   r6,r3
        !            16:        shrl    r6,r4,r4
        !            17:        jneq    inr00
        !            18: 
        !            19: cmpshift:
        !            20:                                /* compute the shift (r4). */
        !            21:        subl3   r3,$HID_POS,r4
        !            22:        jlss    shiftr          /* if less then zero we shift right. */
        !            23:        shll    r4,r0,r0        /* else we shift left. */
        !            24:        subl2   r4,r2           /* uodate exponent. */
        !            25:        jleq    underflow       /* if less then 0 (biased) it is underflow. */
        !            26:        jmp     combine         /* go to combine exponent and fraction. */
        !            27: shiftr:
        !            28:        mnegl   r4,r4
        !            29:        shrl    r4,r0,r0        /* shift right. */
        !            30:        addl2   r4,r2           /* update exponent */
        !            31:        cmpl    r2,$256
        !            32:        jgeq    overflow        /* check for overflow. */
        !            33: combine:
        !            34:        andl2   $CLEARHID,r0    /* clear the hidden bit. */
        !            35:        shal    $EXPSHIFT,r2,r2 /* shift the exponent to its proper place. */
        !            36:        orl2    r2,r0
        !            37:        ret
        !            38: 
        !            39: underflow:
        !            40:        orl2    $HFS_UNDF,*4(fp)        
        !            41:        ret
        !            42: 
        !            43: overflow:
        !            44:        orl2    $HFS_OVF,*4(fp)
        !            45:        ret
        !            46: retzero:
        !            47:        clrl    r0
        !            48:        ret
        !            49:        

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.