MOV src、dest(或)MOV dest、src? [英] MOV src, dest (or) MOV dest, src?

查看:39
本文介绍了MOV src、dest(或)MOV dest、src?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MOV 可能是每个人在学习 ASM 时学到的第一条指令.

MOV is probably the first instruction everyone learns while learning ASM.

刚刚遇到一本书Rajat Moona 撰写的 GNU/Linux 中的 IA32 架构汇编语言编程链接已删除)

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 称为 英特尔语法.(例如 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆