Annotation of 3BSD/cmd/px/24case.s, revision 1.1.1.1

1.1       root        1: #
                      2: # 24case.s
                      3: #
                      4: # CASE OPERATORS
                      5: #
                      6: _CASE1OP:
                      7:        cvtbw   (r10)+,r0
                      8:        bneq    l2401
                      9:        cvtwl   (r10)+,r0       #r0 has length of case table
                     10: l2401:
                     11:        movaw   (r10)[r0],r2    #r2 has pointer to cases
                     12:        cvtwb   (sp)+,r3        #r3 has case element to find
                     13:        locc    r3,r0,(r2)      #find case element
                     14:        beql    caserr          #case not found
                     15: offset:
                     16:        mnegl   r0,r0           #calc new lc
                     17:        cvtwl   (r2)[r0],r1
                     18:        addl2   r1,r10
                     19:        jmp     (r8)
                     20: _CASE2OP:
                     21:        cvtbl   (r10)+,r0
                     22:        bneq    l2402
                     23:        cvtwl   (r10)+,r0       #r0 has length of case table
                     24: l2402:
                     25:        movaw   (r10)[r0],r1    #r1 has pointer to cases
                     26:        movl    r1,r2           #save base pointer
                     27:        movw    (sp)+,r3        #r3 has case element to find
                     28: l2403:
                     29:        cmpw    r3,(r1)+        #search for case
                     30:        beqlu   offset
                     31:        sobgtr  r0,l2403
                     32:        brb     caserr          #not found
                     33: _CASE4OP:
                     34:        cvtbl   (r10)+,r0
                     35:        bneq    l2404
                     36:        cvtwl   (r10)+,r0       #r0 has length of case table
                     37: l2404:
                     38:        movaw   (r10)[r0],r1    #r1 has pointer to cases
                     39:        movl    r1,r2           #save base pointer
                     40:        movl    (sp)+,r3        #r3 has case element to find
                     41: l2405:
                     42:        cmpl    r3,(r1)+        #search for case
                     43:        beqlu   offset
                     44:        sobgtr  r0,l2405
                     45: caserr:
                     46:        movw    $ECASE,_perrno
                     47:        jbr     error

unix.superglobalmegacorp.com

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