I'm reading some information on Instruction Operands for x86 which is basically explaining the process in which Operands are parameters that are used with assembler mnemonics.
Quote:
mnemonic destination, source
Example:
mov eax, 1
MOV is the reserved name for a family of opcodes while EAX is the destination operand and 1 is the source operand. The operating copies the operand 1 into EAX.
Im still learning assembler so this is all very new to me!
Question, why do we move from right to left?
In intro to operands it says that " the right operand is the source and the left operand is the destination." Is this always true with x86? Do we always have to move from right to left and if so a short explanation would be wonderful.
Right to left is comon in x86 assembler but it is a notation issue, not a hardware one. AT&T assembler for x86 is left to right.
Consider this:
x = 1
and compare to this:
eax = 1
mov eax, 1
Now you can see that "normal" human assumptions about assignments in programing languages are form right to left.
And MOV EAX,1 is an assignment. Data does not "move" from "1" to "EAX". Instead "EAX" is assigned a value of "1".
There are many "presumed" wrong notations in x86 syntax... but IF you think about it THEN you will realize they are in fact the correct notations :green
BogdanOntanu and Hutch thanks a lot guys I'm starting to understand x86 assembly a lot better now its all starting to make since or at least the basics are! I've been a member here for over a year! I've been really trying to grasp everything and now its all starting to come together. I don't just want to code in asm... I want to truly understand everything without skipping over all the good stuff. :)