Annotation of 43BSDTahoe/usr.lib/libF77/CCI/s_cmp_s.s, revision 1.1.1.1

1.1       root        1: #      "@(#)s_cmp_s.s  5.1 (Berkeley) 11/3/86"
                      2: 
                      3: .data
                      4: .text
                      5: LL0:.align     1
                      6: .globl _s_cmp
                      7: .set   MASK__,0x1004
                      8: .data
                      9: .text
                     10: _s_cmp:.word   MASK__
                     11: movl   4(fp),r0                /* a */
                     12: movl   8(fp),r1                /* b */
                     13: movl   12(fp),r12              /* la */
                     14: cmpl   r12,16(fp)              /* if (la <= lb) */
                     15: jgtr   L17
                     16: movl   r12, r2                 /* compare according to la */
                     17: cmps3
                     18: jeql   L2                      /* if not equal */
                     19: 
                     20: L20:
                     21: cvtbl  (r0), r0                /* return(*a - *b) */
                     22: cvtbl  (r1), r1
                     23: subl2  r1,r0
                     24: ret
                     25: 
                     26: L2:
                     27: cmpl   r12,16(fp)              /* if (la == lb) */
                     28: jneq   L50
                     29: clrl   r0                      /* then strings are equal */
                     30: ret
                     31: 
                     32: L50:
                     33: addl3  8(fp), 16(fp), r12      /* r12 = bend */
                     34: 
                     35: L3:
                     36: cmpb   (r1), $32               /* if *b != space */
                     37: jeql   L4
                     38: cvtbl  (r1), r1
                     39: movl   $32, r0                 /* return(' ' - *b) */
                     40: subl2  r1, r0
                     41: ret
                     42: 
                     43: L4:                            /* else loop */
                     44: incl   r1
                     45: cmpl   r1, r12
                     46: jlssu  L3                      /* till bend */
                     47: clrl   r0
                     48: ret                            /* strings equal: return(0) */
                     49: 
                     50: 
                     51: L17:                           /* else */
                     52: movl   16(fp), r2              /* compare according to lb */
                     53: cmps3
                     54: jneq   L20                     /* if not equal */
                     55:                                /* return(*a - *b) */
                     56: addl3  4(fp), 12(fp), r12      /* r12 = aend */
                     57: 
                     58: L30:
                     59: cmpb   (r0), $32               /* if *a != space */
                     60: jeql   L40
                     61: cvtbl  (r0), r0
                     62: movl   $32, r1                 /* return(*a - ' ') */
                     63: subl2  r1, r0
                     64: ret
                     65: 
                     66: L40:                           /* else loop */
                     67: incl   r0
                     68: cmpl   r0, r12
                     69: jlssu  L30                     /* till bend */
                     70: clrl   r0
                     71: ret                            /* strings equal: return(0) */
                     72: 

unix.superglobalmegacorp.com

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