gpt4 book ai didi

assembly - NASM 中 %rep 部分的标签

转载 作者:行者123 更新时间:2023-12-05 00:57:07 25 4
gpt4 key购买 nike

我有 %rep创建预处理器循环的预处理器指令。
我想在其中声明标签,可能带有一些连接,但我无法获得正确的语法。

%assign i 0 
%rep 64
label_%i: ;this, of course, doesn't work
inc rax
%assign i i+1
%endrep

那么如何强制NASM预处理器生成 label_i每次“迭代”?

最佳答案

这可以通过使用 %+ 来完成。符号。以下是文档的摘录:

4.1.4 Concatenating Single Line Macro Tokens: %+

Individual tokens in single line macros can be concatenated, to produce longer tokens for later processing. This can be useful if there are several similar macros that perform similar functions.

Please note that a space is required after %+, in order to disambiguate it from the syntax %+1 used in multiline macros.



可以在 here 中找到有关预处理器中的此功能和其他功能的更多信息。 .

关于assembly - NASM 中 %rep 部分的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34981743/

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