Ref:  Your note of 31 January 2018, 07:49:38 EST

The MVST (move string) instruction provides the appropriate primitive to
implement strcpy() and strncpy(), and became available in the 390
string-instruction facility at the same time as SRST (search string)
which implements strlen().  The same facility also added CLST (compare
logical string) which is equivalent to strcmp() and strncmp().

Peter Relson writes (quoting someone else):
> >I believe that nowadays the z has strlen() and
> >strcpy() in microcode.
>
> To quibble, that seems like a somewhat backwards statement. Nowadays z has
> an instruction (SRST, whether it is in the hardware, microcode, or
> millicode) that accomplishes what strlen wants to do. And therefore the
> compiler will take advantage of that instruction when the length of a
> 0-delimited string is wanted. But there are other uses for this
> instruction than finding the length of a 0-delimited string. So it's
> really not that the c function is "in" anything, but rather that it can be
> accomplished by an instruction that z provides.
>
> I don't know of something similar for strcpy (but there are a lot of the
> 2144 instructions/extended mnemonics that I know next to nothing about).

Jonathan Scott
HLASM, IBM Hursley, UK

Reply via email to