gpt4 book ai didi

assembly - 消除 Intel 语法中寄存器名称中标签的歧义

转载 作者:行者123 更新时间:2023-12-02 20:13:57 27 4
gpt4 key购买 nike

我想知道如何在英特尔语法中的某些指令中区分标签名称和寄存器名称。例如,call rdx通常意味着间接跳转,但是如果我们在同一个汇编文件中有一个标签rdx怎么办?我相信它可以被解释为直接跳转到 rdx 。有没有什么符号可以告诉汇编器哪个是哪个?

最佳答案

Is there any notation to tell the assembler which is which?

这取决于您使用的汇编器。没有通用语法可以执行此操作。

然而,一些汇编器具有区分标签和保留字的功能。例如section "3.1 Layout of a NASM Source Line" in the nasm documentation指出,您可以在标签前加上 $ 前缀,以将其与寄存器区分开来:

An identifier may also be prefixed with a $ to indicate that it is intended to be read as an identifier and not a reserved word; thus, if some other module you are linking with defines a symbol called eax, you can refer to $eax in NASM code to distinguish the symbol from the register

关于assembly - 消除 Intel 语法中寄存器名称中标签的歧义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57605964/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com