大会中运营商的优先级 [英] priority of operators in Assembly

查看:103
本文介绍了大会中运营商的优先级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我的朋友

我已经尝试了很多,我是程序优先考虑你的运算符写入汇编。请任何人都可以帮助朋友,并且是一个程序的示例,它介绍我优先考虑操作符指定,例如,计算表达式作为输入和输出基于获得基于返回的优先级。



输入:

(2 + 3)/ 2 * 3;

解决方案

参见 http://msdn.microsoft.com/en-us/library/126fe14k.aspx [ ^ ]。


程序集语言本身没有运营商。它与其他语言不同,因为它不是适用于所有处理器的单一语言。该程序由处理器指令组成。不需要优先级,因为指令具有描述的确切含义,特别是在处理器文档中,并且执行顺序(当然,在单个线程/光纤中)由这些指令的顺序定义。没有也不会有任何含糊之处。



至于你在问题中显示的表达式示例,这实际上并不是代码的一部分。您可以使用一些编译时表达式(它完全取决于Assembly编译器的版本而与处理器无关)。编译器计算这些静态已知的值并在编译的生成中使用它,因为它们是您使用它们时的立即常量。我不认为操作员的优先级可能过于复杂或与任何高级计算机语言有太大差别。



-SA

hello My Friends
I've tried a lot and I'm the program prioritize your operator to write in Assembly. Please anyone can you help friends and is an example for a program that introduced me to prioritize the operator specifies, for example, a computational expression as input and outputs based on get prioritized based on returns.

input :
(2+3)/2*3;

解决方案

see http://msdn.microsoft.com/en-us/library/126fe14k.aspx[^].


Assembly language itself does not have operators. And it is not like other languages, as it is not one single language applicable to all processors. The program is composed of processor instructions. No priority is needed, because instructions have exact meaning described, in particular, in processor documentation, and the order of execution (in a single thread/fiber, of course) is defined by order of those instructions. There is no and cannot be any ambiguity.

As to the expression example you've shown in your question, this is not actually a part of the code. You can use some compile-time expression (it totally depends on the version of the Assembly compiler and not related to the processor). The compiler computes such statically known values and use it in the production of compilation as they were the immediate constants at the point where you use them. I don't think the priority of operator can be too complex or much different from any high-level computer language.

—SA


这篇关于大会中运营商的优先级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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