NASM与AT& T公司语法:有什么优势? [英] NASM versus AT&T Syntax: what are the advantages?

查看:339
本文介绍了NASM与AT& T公司语法:有什么优势?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要通过英特尔处理器文档和在同一时间写一些基本的汇编code。我都 NASM (GAS)我的服务器上,我理解这两个装配的基本差异有。

I'm going through the Intel processor documentation and writing some basic assembly code at the same time. I have both nasm and as (GAS) on my server and I understand the basic differences of both assemblers.

在长远:


  • 围绕这些语法是一个更好的主意吗?

  • 有哪些优势和这些语法的缺点是什么?

  • 哪一个更广泛的应用和理解?

我也AP preciate任何preferences你能与我分享。

I would also appreciate any preferences you could share with me.

推荐答案


  • 围绕这些语法是一个更好的主意吗?

取决于你的项目。不是每个编译器允许这两种语法。如果你需要有装配在其他平台上code英特尔可能会更好,即使若干年后与两个我个人很喜欢英特尔的更多,但it`sa小的差异的经验,它并没有真正对我很重要。

Depends on your projects. Not every compiler does allow both kinds of syntax. If you need to have to code assembled on other platforms Intel is probably better, even after some years experience with both I personally like Intel more, but it`s a small difference, and it doesn't really matter to me.


  • 有哪些优势和这些语法的缺点是什么?

在AT& T公司的语法有小幅如果你需要使用宏是多少,甚至更多。 OTOH我preFER的的源,目标的顺序,但是那个人品味,别人也许周围的其他方法preFER它,因为它类似于一个赋值运算符的书写顺序说C(和还有更多)。

In the AT&T syntax there are slightly to much %, even more if you need to use macros. OTOH I prefer the source, destination ordering, but thats personal taste, others may prefer it the other way around because it resembles the writing order of an assignment operator in say C (and many more).

我INTEL语法就像 DWORD PTR ,其中AT&放脏话;吨小追加就足够了。助记符的准确拼写不同,在许多情况下,我觉得AT& T公司更符合逻辑的,而当然英特尔的办法就是标准。在英特尔的寻址模式在某种程度上更具可读性。

I INTEL syntax the are obscenities like DWORD PTR, where in AT&T a small appended l is sufficient. The exact spelling of the mnemonics differs in many cases, I find the AT&T more logical while of course Intels way is the standard. The addressing modes in Intel are somewhat more readable.


  • 哪一个更广泛的应用和理解?

我相信AT& T公司是比较常用的,因为Linux的嵌入式平台中,汇编器更经常使用的无所不在的其它软件项目。还有更多的装配该明白英特尔的语法,这是非常真实的,但我相信,海湾合作委员会/气是行业里的汇编事项/很有用更用了。

I believe AT&T is more used, because of the ubiquitousness of linux on embedded platforms, where assembler is much more often used that in other software projects. There are more assemblers which understand Intels syntax, that much is true, but I believe gcc/gas is more used in a field where assembler matters/is useful .

这篇关于NASM与AT& T公司语法:有什么优势?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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