Annotation of 43BSDReno/sys/tahoe/udiv.s, revision 1.1.1.1

1.1       root        1: /*
                      2:  *     @(#)udiv.s      7.1 (Berkeley) 5/21/88
                      3:  */
                      4: 
                      5: #include "../tahoe/SYS.h"
                      6: 
                      7: /*
                      8:  * result = udiv(dividend, divisor)
                      9:  *
                     10:  * unsigned long division
                     11:  */
                     12:        .text
                     13: ASENTRY(udiv, R2|R3)
                     14:        bitl    $0x80000000,8(fp)       # if (divisor & 0x80000000) {
                     15:        jeql    2f                        
                     16:        cmpl    8(fp),4(fp)             # if (divisor > dividend)
                     17:        jlequ   1f
                     18:        clrl    r0                      #       return (0);
                     19:        ret
                     20: 1:                                     # else
                     21:        movl    $1,r0                   #       return (1);
                     22:        ret                             # }
                     23: 2:
                     24:        clrl    r0                      # return (dividend / divisor);
                     25:        movl    4(fp),r1
                     26:        ediv    8(fp),r0,r2,r3
                     27:        movl    r2,r0
                     28:        ret

unix.superglobalmegacorp.com

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