home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19389 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.4 KB

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