Annotation of researchv10no/cmd/xref/divide.s, revision 1.1.1.1

1.1       root        1: / long / int
                      2: 
                      3:        .globl  _divide
                      4: _divide:
                      5:        jsr     r5,csv
                      6:        mov     6(r5),r3        / divisor
                      7:        mov     4(r5),r4        / dividend address
                      8: 
                      9:        clr     r0
                     10:        mov     0(r4),r1        / hi dividend
                     11:        div     r3,r0
                     12:        mov     r0,0(r4)        /high quotient
                     13:        mov     r1,r0           / r
                     14:        mov     2(r4),r1        / lo dividend
                     15:        div     r3,r0
                     16:        bvc     1f
                     17:        sub     r3,r0           / this is the clever part
                     18:        div     r3,r0
                     19:        tst     r1
                     20:        bge     1f
                     21:        add     r3,r1
                     22:        dec     r0
                     23: 1:
                     24:        mov     r0,2(r4)        / lo quotient
                     25:        mov     r1,r0           / remainder
                     26:        jmp     cret

unix.superglobalmegacorp.com

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