Annotation of 40BSD/cmd/px/05index.s, revision 1.1.1.1

1.1       root        1: #
                      2: # Copyright (c) 1979 Regents of the University of California
                      3: #
                      4: # char sccsid[] = "@(#)05index.s 4.1 10/10/80";
                      5: #
                      6: # OFF, INDEX and NIL
                      7: #
                      8: _OFF:
                      9:        cvtbl   (r10)+,r0
                     10:        bneq    l0501
                     11:        movzwl  (r10)+,r0
                     12: l0501:
                     13:        addl2   r0,(sp)
                     14:        jmp     (r8)
                     15: _INX2:
                     16:        cvtbl   (r10)+,r0
                     17:        bneq    l0502
                     18:        cvtwl   (r10)+,r0       #r0 has size
                     19: l0502:
                     20:        clrl    r3              #r3 has base subscript
                     21:        subw3   (r10)+,(sp)+,r3
                     22:        blss    esubscr         #check lower bound
                     23:        cmpw    r3,(r10)+       #check upper bound
                     24:        bgtru   esubscr
                     25:        mull2   r0,r3           #calc byte offset
                     26:        addl2   r3,(sp)         #calculate actual address
                     27:        jmp     (r8)
                     28: _INX4:
                     29:        cvtbl   (r10)+,r0
                     30:        bneq    l0503
                     31:        cvtwl   (r10)+,r0       #r0 has size
                     32: l0503:
                     33:        cvtwl   (r10)+,r1       #r1 has lower bound
                     34:        movzwl  (r10)+,r2       #r2 has upper-lower bound
                     35:        subl3   r1,(sp)+,r3     #r3 has base subscript
                     36:        cmpl    r3,r2           #check for out of bounds
                     37:        bgtru   esubscr
                     38:        mull2   r0,r3           #calc byte offset
                     39:        addl2   r3,(sp)         #calculate actual address
                     40:        jmp     (r8)
                     41: esubscr:
                     42:        movl    $ESUBSCR,_perrno
                     43:        jbr     error
                     44: _NIL:
                     45:        incl    r10
                     46:        tstl    (sp)
                     47:        jeql    l0504
                     48:        jmp     (r8)
                     49: l0504:
                     50:        movw    $ENILPTR,_perrno
                     51:        jbr     error
                     52: _INX4P2:
                     53:        cvtbl   (r10)+,r0       #r0 has shift amount
                     54:        cvtwl   (r10)+,r2       #r2 has lower bound
                     55:        subl3   r2,(sp)+,r1     #r1 has base subscript
                     56:        ashl    r0,r1,r1
                     57:        addl2   r1,(sp)
                     58:        jmp     (r8)
                     59: _INX2P2:
                     60:        cvtbl   (r10)+,r0       #r0 has shift amount
                     61:        cvtwl   (r10)+,r1       #r1 has base array value
                     62:        cvtwl   (sp)+,r2        #r2 has subscript value
                     63:        subl2   r1,r2           #r2 has element offset
                     64:        ashl    r0,r2,r2        #r2 has byte offset
                     65:        addl2   r2,(sp)
                     66:        jmp     (r8)

unix.superglobalmegacorp.com

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