Moving data in assembly language:
MOV B, A
If I move content from internal register A to register B, what happens to content of register A? Is it deleted? Stays unchanged?
Moving data in assembly language:
MOV B, A
If I move content from internal register A to register B, what happens to content of register A? Is it deleted? Stays unchanged?
The MOV
command will leave the contents of register A alone. From some x86 documentation (emphasis added):
The mov instruction copies the data item referred to by its second operand (i.e. register contents, memory contents, or a constant value) into the location referred to by its first operand (i.e. a register or memory).
http://www.cs.virginia.edu/~evans/cs216/guides/x86.html
There are many other assembly languages, but you can count on most modern languages working the same way.
The answer depends heavily on the CPU and assembly language you're targeting:
MOV target, source
mov source, target
MOV target, source
The source is left unchanged for a move.
Out of curiosity, and nostalgy, a couple of older CPUs used other covnetions as well:
MOV source, target
MOVE source, target
MOV
, but uses several variants of loads and stores, the first using targe, source, and the second source, target. It also had several variants of move but called differently keepng from the naming convention only the first letter.