GNU as: 在intel_syntax中转义符号名称

huangapple go评论51阅读模式
英文:

GNU as: Escape symbol names in intel_syntax

问题

使用GNU as的.intel_syntax,一些标识符显然会变成关键字,比如写下以下代码来调用名为and的函数:

call and

会导致以下错误:

Error: invalid use of operator "and"

你如何绕过这个问题?

英文:

With GNU as .intel_syntax, some identifiers apparently become keywords, and writing e.g.

call and

to invoke a function called and results in

Error: invalid use of operator "and"

How do you circumvent this?

答案1

得分: 2

好的,答案似乎是:

这是不可能的。使用AT&T语法。

查看GAS源代码,config/tc-i386-intel.c的136行及之后对此有很明确的说明。

某些GNU开发者认为完全禁用某些符号名称是引入命名操作符的一种合理方式。这样一个小而不好的设计决策让我以及可能还有许多其他不幸的用户浪费了整个下午的时间。不要成为那个人。

英文:

Alright, the answer seems to be:

This is not possible. Use AT&T syntax.

Looking at the GAS sources, config/tc-i386-intel.c lines 136ff are pretty clear about this.

Some GNU developer considered completely disabling some symbol names to be a reasonable way of introducing named operators. Such a small bad design decision cost me and probably many other unfortunate users a whole afternoon. Don't be that guy.

huangapple
  • 本文由 发表于 2023年7月14日 01:07:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76681795.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定