On Tue, 22 Oct 2024 at 08:03, Peter Relson <rel...@us.ibm.com> wrote:
> Tony H wrote: > <snip> > everything wrapped into one instruction, i.e. strncpy(). > </snip> > > I'd hardly call strncpy "one instruction", rather one function / one "line > of code". It probably is implemented using some of the instructions that > you're thinking of. > Yes, clearly strncpy() is not a single machine instruction - that's why I put the () after it to give it a C flavour. I think Gil was suggesting actually calling strncpy(), though from what library and with what required environment is unclear, and that probably makes sense given all the compiler expertise and optimizations that go into such things. It doubtless wouldn't hurt to look at the generated code when it gets inlined. Shmuel wanted a single machine instruction, I gather, and there is something to be said for an instruction that takes two lengths and also scans for a delimiter and so provides safety while avoiding two passes over the data. Maybe yet another addition to MVCOS...? Tony H. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN