MOV (x86 instruction)
From Free net encyclopedia
In the X86 assembly language, the MOV instruction is a mnemonic for the copying of data from one location to another. The x86 assembly language actually contains a number of different opcodes that perform a move. Depending on whether the processor is in real mode or protected mode, and an override instruction is used, the instruction may transfer 8-bits, 16-bits, or 32-bits of data. Data may be copied to and from memory and registers.
The following is an example of Intel syntax:
MOV X, Y
In AT&T assembler syntax, the above operation would be accomplished as follows:
MOVB $Y, X
Either X or Y can include addressing information.
The arguments for the MOV commands can be either a register, segment register or a memory address. since the command is executed in a single CPU work cycle, not all combinations of arguments are possible. possible combinations:
move the content of the register bx into the register ax
MOV ax, bx
move the content of the register ax into the memory block with the specified address
MOV [address], ax
A combination which is not possible, is a move from memory to memory, for example :
MOV [address1], [address2]
to achieve this, another MOV must be used:
MOV ax, [address2] MOV [address1], ax