assembly - 带有前导 $ 的 NASM 外部符号

标签 assembly nasm symbols

NASM 文档指出:

The only characters which may be used as the first character of an identifier are letters, . (with special meaning: see section 3.9), _ and ?.

我需要调用一个外部过程,其符号以前导$开头。遗憾的是,文档没有指定如何转义 $ 或如何处理限制。

有人知道如何指定带有前导美元符号的外部符号吗?

最佳答案

I need to call an external procedure whose symbol starts with a leading $. Sadly the docs do not specify how to escape the $ or how to deal with the restriction.

文档没有解释这一点,因为这是不可能的。 extern directive将始终忽略前导 $ (寄存器 rax 与标签 rax 之间没有歧义,因为寄存器不能在标签声明中使用)。 任何标识符的第一个实际字符必须是 categorized as NCT_IDSTART ,否则无效。

关于assembly - 带有前导 $ 的 NASM 外部符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63586178/

相关文章:

c - 预计 GCC ARM 寄存器

c - 从 C 执行二进制机器代码

c - 同一内存地址处的两个不同值 - 汇编

c++ - 为库中的 C++ 模板实例强制定义符号

assembly - x86中的BEXTR指令是如何工作的

assembly - 从 FPU 堆栈中删除某些内容的最简单方法

assembly - QWORD 在 64 位机器上的大小是多少?

linux - 使用数组组装 x86 中的汉诺塔

python:更改符号变量并分配数值

Ruby - intern 和 to_sym 有什么区别