Path: utzoo!mnetor!uunet!lll-winken!lll-tis!mordor!sri-spam!sri-unix!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: strcpy Message-ID: <848@cresswell.quintus.UUCP> Date: 2 Apr 88 10:27:02 GMT References: <7712@apple.Apple.Com> <7485@brl-smoke.ARPA> <10731@mimsy.UUCP> <10895@mimsy.UUCP> Organization: Quintus Computer Systems, Mountain View, CA Lines: 15 Summary: VAX string instructions In article <10895@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes: > In article <4295@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes: > >And so far nobody has named a compiler/library/OS/environment > >that *doesn't* just copy left to right. > > To be fair, I *do* know of one: The 4.3BSD Vax strcpy() uses the Vax > locc and movc3 instructions. movc3 moves in whichever direction is > nondestructive. This implies that > This may not be such a wonderful idea: according to the DEC manuals, some VAX models do not implement the locc instruction. (The machine will trap to some sort of library which emulates the missing instructions.) Getting this right for strings longer than 2^16-a few characters must be a nightmare: both locc and movc3 have a 16-bit length operand. (This has never made sense to me.)