汇编语言标准 [英] Assembly language standard

查看:162
本文介绍了汇编语言标准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

时有标准定义的语法语义汇编语言?同样作为语言的 C ISO 标准和语言的 C# ECMA 标准?在那里只有一个标准,还是有更多的人?

Is there a standard that defines the syntax and semantics of assembly language? Similarly as language C has ISO standard and language C# has ECMA standard? Is there only one standard, or are there more of them?

我这么问是因为我注意到汇编语言 $ C $ç看了不同的窗口的Linux 环境。我希望汇编语言是不依赖于操作系统,它的唯一的语言,用一些定义的标准,并通过汇编程序(汇编语言编译器)被翻译成机器指令作为特定< STRONG>处理器

I'm asking because I noticed that assembly language code looked different on Windows and Linux environment. I hoped that assembly language is not dependent on OS, that it's only language with some defined standard and via assembler (compiler of assembly language) is translated into machine instructions for particular processor.

感谢您的答案

推荐答案

最接近的一个标准是,创建该处理器/指令集将有一个文档描述了语言,往往是供应商的供应商将提供某种汇编(程序)。有些厂商是面向比别人让你得到你所得到的更多的细节和标准。然后,事情是这样的Intel / AT&amp; T公司发生把事情搞得一团糟。再加上GNU汇编喜欢把事情弄糟它支持的芯片的汇编语言以及所以一般你有混乱。

The closest thing to a standard is that the vendor that created the processor/instruction set will have a document describing that language and often that vendor will provide some sort of an assembler (program). Some vendors are more detail and standard oriented than others so you get what you get. Then things like this intel/at&t happen to mess things up. Add to that gnu assembler loves to mess up the assembly language for the chips it supports as well so in general you have chaos.

如果有一个汇编语言使用的则相当于C或C ++,那么你会期望一个组织,试图拿出一个标准。问题的部分仍然是与东西像C语言有一个跨pretation它击中硬件之前,用汇编了,没有人很少所以芯片供应商将会做出他们想要做出应有的市场因素和标准将必须沿拖动到硬件匹配,而不是周围的地方标准驱动厂商的其他方式。

If there were an assembly language whose use were comparable to C or C++ then you would expect an organization to try to come up with a standard. Part of the problem would still be that with things like the C language there is an interpretation before it hits the hardware, with assembler there is none to very little so a chip vendor is going to make whatever they want to make due to market factors and the standard would have to be dragged along to match the hardware, instead of the other way around where a standard drives the vendors.

该处理器的OpenCore可能是一个可以推动的标准,因为它是不特定于供应商,或许已经是。

The opencore processor might be one that could be standards driven since it is not vendor specific, perhaps it is already.

通过组装假设每个汇编程序/软件/工具的每个版本都有相同的指令在不同的指令集设置,以及在其自己的语法规则。 (这实际上是你用C / C ++得到但那是另一个话题),要么选择自己喜欢的工具,只知道它,或尝试所有的工具记住所有的变化,还是我的preference是尽量避免因为许多工具特定的语法和细微差别,并试图找到中间立场的工作,或者至少具有跨工具工作的机会或端口。

With assembly assume that each version of each assembler program/software/tool has its own syntax rules within the same instruction set as well as across different instruction sets. (which is actually what you get with C/C++ but that is another topic) either choose your favorite tool and only know it, or try to memorize all the variations across all the tools, or my preference is to try to avoid as many tool specific syntax and nuances, and try to find the middle ground that works or at least has a chance to work or port across tools.

这篇关于汇编语言标准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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