# 2.11BSD#431 - /usr/src/lib/libc/pdp/gen/strncmp.s

##### Functions

    _strncmp          X

       1: /*
       2:  * Copyright (c) 1987 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #ifdef LIBC_SCCS
       8:         <@(#)strncmp.s	1.1 (Berkeley) 1/21/87\0>
       9:         .even
      10: #endif LIBC_SCCS
      11:
      12: /*
      13:  * Compare at most n characters of string
      14:  * s1 lexicographically to string s2.
      15:  * Return:
      16:  *	0	s1 == s2
      17:  *	> 0	s1 > s2
      18:  *	< 0	s2 < s2
      19:  *
      20:  * strncmp(s1, s2, n)
      21:  *	char *s1, *s2;
      22:  *	int n;
      23:  */
      24: #include "DEFS.h"
      25:
      26: ENTRY(strncmp)
      27:         mov     6(sp),r0        / r0 = n
      28:         beq     4f              / (all done if n == 0 - return 0)
      29:         mov     2(sp),r1        / r1 = s1
      30:         mov     r2,-(sp)        / need an extra register for s2 ...
      31:         mov     6(sp),r2        / r2 = s2
      32: 1:
      33:         cmpb    (r1)+,(r2)      / compare the two strings
      34:         bne     5f              / stop on first mismatch
      35:         tstb    (r2)+           / but don't pass end of either string
      36:         beq     2f
      37:         sob     r0,1b           / and n running out will stop us too ...
      38: 2:
      39:         clr     r0              / fell off end of strings while still matching
      40: 3:
      41:         mov     (sp)+,r2        / restore r2
      42: 4:
      43:         rts     pc              / and return
      44: 5:
      45:         movb    -(r1),r0        / mismatch, return *s1 - *s2 ...
      46:         movb    (r2),r1         / (no subb instruction ...)
      47:         sub     r1,r0
      48:         br      3b

#### Defined functions

_strncmp defined in line 26; used 504 times

- in /usr/include/string.h line 17
- in /usr/src/bin/ar/archive.c line 144
- in /usr/src/bin/ar/misc.c line 125
- in /usr/src/bin/awk/main.c line 63
- in /usr/src/bin/ld/ld.c line 1841, 2061
- in /usr/src/bin/mail.c line 452
- in /usr/src/bin/make/files.c line 239, 473, 513
- in /usr/src/bin/mt.c line 74
- in /usr/src/bin/nm/nm.c line 100, 325
- in /usr/src/bin/ps.c line 185-188(2), 235-236(2), 373, 438(2), 483
- in /usr/src/bin/rmail.c line 60(2), 84
- in /usr/src/bin/tcsh/sh.c line 233
- in /usr/src/bin/tcsh/sh.h line 715
- in /usr/src/bin/tcsh/tc.func.c line 428-429(2)
- in /usr/src/bin/tcsh/tc.who.c line 263, 278
- in /usr/src/bin/wall.c line 100
- in /usr/src/bin/write.c line 106
- in /usr/src/games/hack/crypt.c line 787
- in /usr/src/games/hack/hack.do_name.c line 249, 268
- in /usr/src/games/hack/hack.end.c line 291, 346, 392, 399, 409, 420-421(2), 531, 573, 608
- in /usr/src/games/hack/hack.engrave.c line 43
- in /usr/src/games/hack/hack.main.c line 59, 100, 189-190(2)
- in /usr/src/games/hack/hack.objnam.c line 215, 254, 350-356(3), 394-402(3), 410, 464-467(2)
- in /usr/src/games/hack/hack.options.c line 44-69(6), 75-80(2), 88-92(2), 98, 111, 145
- in /usr/src/games/hack/hack.rip.c line 40
- in /usr/src/games/hack/hack.shk.c line 191, 237, 385, 804
- in /usr/src/games/hack/hack.termcap.c line 33
- in /usr/src/games/hack/hack.topl.c line 137
- in /usr/src/games/hack/makedefs.c line 30, 37
- in /usr/src/games/hunt/answer.c line 315
- in /usr/src/games/hunt/hunt.c line 673, 682
- in /usr/src/games/rogue/curses.c line 455-481(14)
- in /usr/src/games/rogue/init.c line 231-247(8)
- in /usr/src/games/rogue/inventory.c line 551
- in /usr/src/games/rogue/zap.c line 198
- in /usr/src/games/warp/warp.h line 154-155(2)
- in /usr/src/include/strings.h line 22
- in /usr/src/lib/ccom/c02.c line 773
- in /usr/src/lib/libc/gen/getenv.c line 48
- in /usr/src/lib/libc/gen/getttyent.c line 117-123(4)
- in /usr/src/lib/libc/net/rcmd.c line 316
- in /usr/src/lib/libc/net/res_init.c line 76, 89
- in /usr/src/lib/libc/net/ruserpass.c line 71, 90-94(2)
- in /usr/src/lib/libc/string/strstr.c line 61
- in /usr/src/libexec/comsat/comsat.c line 151, 220-221(2)
- in /usr/src/libexec/ftpd/ftpcmd.y line 619
- in /usr/src/libexec/popper/pop_dropinfo.c line 62
- in /usr/src/libexec/popper/pop_send.c line 77
- in /usr/src/libexec/popper/pop_updt.c line 163
- in /usr/src/libexec/talkd/process.c line 163
- in /usr/src/libexec/tcpd/environ.c line 21, 58
- in /usr/src/libexec/telnetd/telnetd.c line 1235
- in /usr/src/libexec/tftpd/tftpd.c line 262-265(2)
- in /usr/src/local/afio/afio.c line 826, 1454, 1800
- in /usr/src/local/ddd/ddd.c line 191
- in /usr/src/local/mp/mp.h line 54
- in /usr/src/local/mp/print.c line 194, 201
- in /usr/src/local/qterm/options.c line 220-223(2)
- in /usr/src/local/zmodem/rz.c line 1116
- in /usr/src/local/zmodem/sz.c line 700, 1616-1617(2)
- in /usr/src/new/PORT/B/src/bed/b.h line 65
- in /usr/src/new/PORT/B/src/bed/getc.c line 753
- in /usr/src/new/PORT/B/src/bed/spos.c line 46, 79
- in /usr/src/new/PORT/B/src/bed/sugg.c line 112
- in /usr/src/new/PORT/B/src/bint/b1lta.c line 598
- in /usr/src/new/PORT/perl.1.0.0/handy.h line 25-26(2)
- in /usr/src/new/PORT/perl.1.0.0/x2p/handy.h line 25-26(2)
- in /usr/src/new/PORT/perl.1.0.10/handy.h line 25-26(2)
- in /usr/src/new/PORT/perl.1.0.10/x2p/handy.h line 25-26(2)
- in /usr/src/new/PORT/perl.1.0.16/handy.h line 25-26(2)
- in /usr/src/new/PORT/perl.1.0.16/x2p/handy.h line 25-26(2)
- in /usr/src/new/ansi/ansitape.c line 589
- in /usr/src/new/crash/route.c line 388
- in /usr/src/new/jove/abbrev.c line 235
- in /usr/src/new/jove/ask.c line 365, 385
- in /usr/src/new/jove/c.c line 586-591(2)
- in /usr/src/new/jove/extend.c line 318, 344, 852
- in /usr/src/new/jove/funcdefs.c line 647
- in /usr/src/new/jove/io.c line 259, 297, 565
- in /usr/src/new/jove/re1.c line 283
- in /usr/src/new/jove/recover.c line 243
- in /usr/src/new/jove/screen.c line 1533
- in /usr/src/new/jove/setmaps.c line 42, 140-144(2), 151-160(3)
- in /usr/src/new/jove/util.c line 914
- in /usr/src/new/kermit5.188/ckcfn3.c line 658
- in /usr/src/new/kermit5.188/ckucmd.c line 1395, 1401, 2208-2209(2), 2218
- in /usr/src/new/kermit5.188/ckudia.c line 1092, 2293
- in /usr/src/new/kermit5.188/ckuscr.c line 219
- in /usr/src/new/kermit5.188/ckutio.c line 1061, 1285, 1296, 2344, 2499
- in /usr/src/new/kermit5.188/ckuus4.c line 1664, 1735, 1999, 2247, 2429
- in /usr/src/new/kermit5.188/ckuus5.c line 1167-1168(2), 1176, 1189, 1587, 2431
- in /usr/src/new/kermit5.188/ckuus6.c line 1006-1008(3)
- in /usr/src/new/kermit5.188/ckuusx.c line 249
- in /usr/src/new/nntp/server/active.c line 161
- in /usr/src/new/nntp/server/ngmatch.c line 113
- in /usr/src/new/nntp/xmit/nntpxmit.c line 145, 587
- in /usr/src/new/notes/src/bnewshead.c line 86, 413, 421
- in /usr/src/new/notes/src/find.c line 68-77(3), 154-162(3)
- in /usr/src/new/notes/src/loadnf.c line 291
- in /usr/src/new/notes/src/newsdump.c line 137, 301-303(3), 378
- in /usr/src/new/notes/src/newsinput.c line 750-752(3), 759-761(3)
- in /usr/src/new/notes/src/nfadmin.c line 88-94(4), 103-113(6)
- in /usr/src/new/notes/src/nfload.c line 34
- in /usr/src/new/notes/src/nfmail.c line 99, 106, 113, 120, 191, 201, 211(2), 284-293(6), 415, 471
- in /usr/src/new/rcs/src/sccstorcs.c line 49, 246
- in /usr/src/new/rn/common.h line 86-87(2)
- in /usr/src/new/vmsbackup/vmsbackup.c line 340, 695-704(3), 733
- in /usr/src/old/dump/dumpitime.c line 73, 97
- in /usr/src/old/dump/dumpoptr.c line 153-158(2), 298, 323
- in /usr/src/old/dump/unctime.c line 54
- in /usr/src/sbin/dump/dumpitime.c line 72, 97
- in /usr/src/sbin/dump/dumpoptr.c line 157-162(2), 286, 311
- in /usr/src/sbin/dump/unctime.c line 54
- in /usr/src/sbin/init/init.c line 29
- in /usr/src/sbin/quotacheck/preen.c line 202
- in /usr/src/sbin/restor/restor.c line 623
- in /usr/src/sbin/shutdown/shutdown.c line 211
- in /usr/src/sbin/slattach/slattach.c line 41
- in /usr/src/sys/pdpstand/NEW/dskinit.c line 666, 1002
- in /usr/src/sys/pdpstand/boot.c line 676, 684
- in /usr/src/ucb/Mail/aux.c line 541-547(3)
- in /usr/src/ucb/Mail/lex.c line 594
- in /usr/src/ucb/PORT/pascal/utilities/pc3.c line 150
- in /usr/src/ucb/PORT/pascal/utilities/pmerge.c line 122, 252, 266, 272, 284, 302, 311, 320, 327, 339, 348, 358, 370
- in /usr/src/ucb/ctags.c line 472, 483-488(4), 965
- in /usr/src/ucb/finger/util.c line 159, 224
- in /usr/src/ucb/from.c line 67
- in /usr/src/ucb/ftp/cmds.c line 133, 140
- in /usr/src/ucb/ftp/domacro.c line 56
- in /usr/src/ucb/indent/indent.c line 1001, 1007, 1013
- in /usr/src/ucb/indent/io.c line 341
- in /usr/src/ucb/last.c line 31-33(3), 207-209(2)
- in /usr/src/ucb/lastcomm.c line 140
- in /usr/src/ucb/man/apropos.c line 151
- in /usr/src/ucb/man/man.c line 119, 174-175(2), 183-184(2), 196-197(2)
- in /usr/src/ucb/msgs/msgs.c line 336, 763, 807
- in /usr/src/ucb/netstat/route.c line 354
- in /usr/src/ucb/rdist/server.c line 799
- in /usr/src/ucb/rlogin.c line 99
- in /usr/src/ucb/rsh.c line 94-106(4)
- in /usr/src/ucb/ruptime.c line 96
- in /usr/src/ucb/rwho.c line 77, 150-156(3)
- in /usr/src/ucb/sccs.c line 484, 783, 799, 875, 994
- in /usr/src/ucb/vacation.c line 175, 239
- in /usr/src/ucb/vgrind/vfontedpr.c line 160, 171, 178, 290-292(2)
- in /usr/src/ucb/w.c line 200
- in /usr/src/ucb/window/ttgeneric.c line 378
- in /usr/src/ucb/window/ttinit.c line 60
- in /usr/src/ucb/window/wwinit.c line 146-148(2)
- in /usr/src/usr.bin/at/at.c line 467-468(2)
- in /usr/src/usr.bin/at/atrun.c line 488
- in /usr/src/usr.bin/file.c line 195-199(2), 467-469(2)
- in /usr/src/usr.bin/find/find.c line 479
- in /usr/src/usr.bin/learn/mysys.c line 42-47(3)
- in /usr/src/usr.bin/lint/lpass2.c line 199, 354
- in /usr/src/usr.bin/m4/stdd.h line 53
- in /usr/src/usr.bin/patch/common.h line 75-76(2)
- in /usr/src/usr.bin/ranlib/touch.c line 65
- in /usr/src/usr.bin/tip/aculib/biz31.c line 216
- in /usr/src/usr.bin/tip/aculib/courier.c line 187
- in /usr/src/usr.bin/uucp/acucntrl.c line 172, 227, 431, 554
- in /usr/src/usr.bin/uucp/aculib/hys.c line 125-126(2)
- in /usr/src/usr.bin/uucp/anlwrk.c line 52
- in /usr/src/usr.bin/uucp/chkpth.c line 50
- in /usr/src/usr.bin/uucp/cico.c line 409, 732, 879
- in /usr/src/usr.bin/uucp/conn.c line 387
- in /usr/src/usr.bin/uucp/gnsys.c line 93
- in /usr/src/usr.bin/uucp/gnxseq.c line 60
- in /usr/src/usr.bin/uucp/subdir.c line 62, 75
- in /usr/src/usr.bin/uucp/uucp.c line 462
- in /usr/src/usr.bin/uucp/uudecode.c line 48
- in /usr/src/usr.bin/uucp/uupoll.c line 45
- in /usr/src/usr.bin/uucp/uusend.c line 233, 252
- in /usr/src/usr.bin/uucp/uusnap.c line 147, 177, 216-222(4), 251
- in /usr/src/usr.bin/uucp/uuxqt.c line 145, 154
- in /usr/src/usr.bin/uucp/versys.c line 35, 45
- in /usr/src/usr.lib/libF77/mkvers.c line 61
- in /usr/src/usr.lib/libI77/mkvers.c line 61
- in /usr/src/usr.lib/libU77/mkvers.c line 61
- in /usr/src/usr.lib/libutil/logout.c line 42
- in /usr/src/usr.sbin/arp/arp.c line 131-135(3)
- in /usr/src/usr.sbin/catman/catman.c line 196
- in /usr/src/usr.sbin/cron/env.c line 174
- in /usr/src/usr.sbin/gettable/gettable.c line 24
- in /usr/src/usr.sbin/inetd/inetd.c line 746
- in /usr/src/usr.sbin/named/tools/nslookup/main.c line 810, 819-832(7), 838-846(5), 852-858(4), 864, 870-874(3), 882-896(5), 904-906(2)
- in /usr/src/usr.sbin/ntp/ntpd.c line 784
- in /usr/src/usr.sbin/sendmail.MX/aux/arpa.c line 330
- in /usr/src/usr.sbin/sendmail.MX/src/collect.c line 78, 310, 316
- in /usr/src/usr.sbin/sendmail.MX/src/deliver.c line 1192, 1479
- in /usr/src/usr.sbin/sendmail.MX/src/main.c line 176, 185-188(2)
- in /usr/src/usr.sbin/sendmail.MX/src/recipient.c line 251
- in /usr/src/usr.sbin/sendmail.MX/src/srvrsmtp.c line 585
- in /usr/src/usr.sbin/sendmail/aux/arpa.c line 330
- in /usr/src/usr.sbin/sendmail/aux/rmail.c line 74(2), 99
- in /usr/src/usr.sbin/sendmail/src/collect.c line 72, 304, 310
- in /usr/src/usr.sbin/sendmail/src/deliver.c line 1137, 1430
- in /usr/src/usr.sbin/sendmail/src/main.c line 171, 180-183(2)
- in /usr/src/usr.sbin/sendmail/src/recipient.c line 258
- in /usr/src/usr.sbin/sendmail/src/srvrsmtp.c line 576
- in /usr/src/usr.sbin/syslogd/syslogd.c line 674

Last modified: 1987-01-25 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1514 |