问题描述
MOV可能是每个人在学习ASM时都会学到的第一条指令.
MOV is probably the first instruction everyone learns while learning ASM.
刚才我遇到了一本书用于IA32体系结构的GNU/Linux中的汇编语言编程,由Rajat Moona 表示:断开的链接已删除)
Just now I encountered a book Assembly Language Programming in GNU/Linux for IA32 Architectures By Rajat Moona which says: (broken link removed)
但是我知道它是MOV dest, src
.就像用src
加载dest
".甚至 Wiki 也是如此.
But I learnt that it is MOV dest, src
. Its like "Load dest
with src
". Even Wiki says the same.
我并不是说作者错了.我知道他是对的.但是我在这里想念什么?
I'm not saying that the author is wrong. I know that he is right. But what am I missing here?
btw ..他正在使用GCC的as
汇编这些指令.但这不应该改变指令语法吗?
btw.. he is using GCC's as
to assemble these instructions. But that shouldn't change the instruction syntax right?
推荐答案
mov dest, src
被称为 Intel语法 . (例如mov eax, 123
)
mov src, dest
被称为 AT& T语法 . (例如mov $123, %eax
)
包括GNU汇编程序在内的UNIX汇编程序都使用AT& T语法,我所知道的所有其他x86汇编程序都使用Intel语法.您可以阅读维基百科上的差异.
UNIX assemblers including the GNU assembler uses AT&T syntax, all other x86 assemblers I know of uses Intel syntax. You can read up on the differences on wikipedia.
这篇关于MOV src,dest(或)MOV dest,src?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!