home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!wupost!csus.edu!netcom.com!netcomsv!ulogic!hartman
- From: hartman@ulogic.UUCP (Richard M. Hartman)
- Newsgroups: comp.lang.c
- Subject: Re: Problem with string processing.
- Message-ID: <824@ulogic.UUCP>
- Date: 7 Jan 93 23:32:43 GMT
- References: <2mqVwB6w165w@cybrspc.UUCP> <811@ulogic.UUCP> <288@heimdall.sdrc.com>
- Distribution: usa
- Organization: negligable
- Lines: 19
-
- SCAS? I'll have to check it out when I get a moment or two,
- a strcpy() w/ SCAS & MOVSW (or whatever the block move instruction
- is) may be a lot quicker than the two loops, (find end, copy chars).
-
- otoh, thinking about it, w/ higher level instructions you only
- need two loops (find end of string one, copy from string 2
- until you hit NULL), the CISC version would be "find end of
- string 1, find length (end) of string 2, move block at string2
- of [length] to end:string1" Two SCAS & one MOVSB, plus maybe
- a little math.... It would be interesting to check out the
- results.... Does anybody know how Borland, Microsoft or Zortech
- implement strcpy()? (actually they probably write it in C instead
- of asm anyway....)
-
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Between the silence of the mountains |
- and the crashing of the sea | -Richard Hartman
- there lies a land I once lived in | hartman@uLogic.COM
- and she's waiting there for me. |
-