gpt4 book ai didi

assembly - 在 NASM 中的符号名称定义后使用或不使用冒号有区别吗?

转载 作者:行者123 更新时间:2023-12-01 11:03:57 25 4
gpt4 key购买 nike

常量声明中的2种形式:

len equ 2
len: equ 2

他们是一样的吗?

如果不是,那么每种申报表的优点或缺点是什么?

最佳答案

这两者的功能区别:

len  equ 2
len: equ 2
完全没有区别。如 NASM doc page 所述:

NASM places no restrictions on white space within a line: labels may have white space before them, or instructions may have no space before them, or anything. The colon after a label is also optional.

(Note that this means that if you intend to code lodsb alone on a line, and type lodab by accident, then that's still a valid source line which does nothing but define a label. Running NASM with the command-line option -w+orphan-labels will cause it to warn you if you define a label alone on a line without a trailing colon.)

关于assembly - 在 NASM 中的符号名称定义后使用或不使用冒号有区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8006365/

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