[Info-vax] Whither VMS?
glen herrmannsfeldt
gah at ugcs.caltech.edu
Fri Oct 9 16:21:21 EDT 2009
VAXman- wrote:
(snip regarding null terminated vs. count field strings)
< With the counted example, long strings might be implemented with
< long moves with the odd remainder being byte moves. That would
< be much more efficient for large data copies than the byte moves.
OK, to be a little closer to the subject of this group, VAX
has the MOVC instruction which can move up to 65535 characters
with one instruction, assuming the length is known.
I suppose LOCC could be used for null terminated strings,
to find the null character. That would be in a loop in case
the string is longer than 65535. MOVTUC could probably do
strcpy(), though with the memory references for the translate
table (which translates everything to itself) it is probably
slower than otherwise. That would still need to be in a loop.
For strncpy() it could be used with the length, and then MOVC
with zero source length to pad the result out to the specified
length.
It seems to me that VAX is a little better for counted strings
than null terminated strings.
Any processor that doesn't set flags on character load/store
will require extra tests for strcpy().
-- glen
More information about the Info-vax
mailing list