[Info-vax] Assembly languages, was: Re: OT: PDP-11 history in arstechnica
    gah4 
    gah4 at u.washington.edu
       
    Thu Mar 17 02:31:12 EDT 2022
    
    
  
On Wednesday, March 16, 2022 at 5:48:43 PM UTC-7, Simon Clubley wrote:
(snip)
> Doesn't anyone else find it strange that the mnemonic across all 
> architectures is some variant of MOVE or MOV instead of COPY or CPY ? 
 
> After all, you are not destroying the contents at the original 
> location/register when you copy it to the target location/register. :-)
I think I might have wondered about that.
C has the memmove() and memcpy() functions, where the former does
it correctly (for some definition of correct) for overlapping areas.
memcpy() gives undefined results in that case.
The S/360 MVC (move characters) is defined to do the move left to
right, character by character, in the case of overlap.  This is commonly
used to clear a buffer by storing a character in the first byte, and then
moving right by one. 
It is done enough that some hardware might optimize for this case.
I suspect that opcodes for many later processors were based, in some
sense, on earlier DEC systems. 
But yes, it is strange.
    
    
More information about the Info-vax
mailing list