strcpy

Richard A. O'Keefe ok at quintus.UUCP
Sat Apr 2 20:27:02 AEST 1988


In article <10895 at mimsy.UUCP>, chris at mimsy.UUCP (Chris Torek) writes:
> In article <4295 at hoptoad.uucp> gnu at 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.)



More information about the Comp.lang.c mailing list