move the contents of the register bx into the register ax
MOV ax, bx
Why is the syntax so strange?
Mov ax,
(to) bx
actually means move
contents of bx
to ax
,is there any historical reason to define it this way?
Consider a code
x = 5
This probably assigns value 5 to x. Would you like 5 = x?
Similarly, You should not try to compare the language English with coding. Thats what historically also happened. English might say move this to that. But computer architects like that to this.
So basically the process of :
X := Y
could be better summarized as :
MOV X, Y
MOV ax, bx
This means, ax = bx (move bx to ax, more exactly, copy bx to ax). In this Assembly syntax first operand is destination - this is usual case, for example, in C functions:
strcpy(dest, source);
In AT&T Assembler first operand is source. Generally, it looks strange and AT&T Assembler users make interesting bugs because of this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With