register variables can't be const in HPUX C- that's why for this example.

What's going on - my job sometimes involves re-writing code sections, even into asm, when it doesn't run fast. Or it isn't readable. Not that the above stuff was readable.

strncpy implementation on HPUX, as you see it in the .as file, is pretty much what I wrote, translated from asm.

I've written MSVC++, Borland, gcc code, and lots of others. I hate not answering a question - but end up being pedantic too often. You can't tell what people know on this Forum.

By the way, strncpy in MSVC++, in my opinion, is not a great choice. I had to work around it about 6 months ago.
For 240 million records with about 20 strncpy calls per record, I sped the loop up by a factor of 230%.

Speaking of weird compilers:

FWIW - if you are into performance and are okay with SDK windows, look into PowerBasic. I know. BASIC and speed are non-sequitor.

PB string handling blows the socks off the standard string library in MSVC++. I write dll's with it all the time. The fix mentioned above is using PB - it also supports inline asm and pointers. In other words it's almost like C with BASIC syntax.