theColonel26
Lifetime Supporting Member
I have found several places in an old program where COP of length 1 is used on strings, but other places where MOV is used. Is there an different in efficiency?
MOV with numeric data behaves as expected with same type tags. With different type tags it interprets the source to fit the destination type. COP does not do any interpretation and copies the bit patterns literally. One such usage is to COPy two adjacent integers into a float. This is usually done with information received depending on communication protocols. COPy can also transfer UDT tags as complete units. One example is a string to string transfer.
Yes there has to be some kind of underlying optimization going on there. It is truly counter intuitive.It is the extra "feature" of the MOV (type-checking and conversion) that I would expect to cause longer execution time. But it doesn't...by a significant multiple. Seems odd.
Keith
My understanding is that the source data (contents) can change during the MOV, instruction.
A COP ensures the source data is frozen in time, until all of the "data" has been copied over.
Once in a blue moon, the timing of the data being received, can cause issues.
hmmmm that is possible that a mov is not atomic. COP placing a lock on the source would indeed add to execution time. Do you have a source that explains it further?My understanding is that the source data (contents) can change during the MOV, instruction.
A COP ensures the source data is frozen in time, until all of the "data" has been copied over.
Once in a blue moon, the timing of the data being received, can cause issues.