在汇编开发中,开发者常常需要使用匿名段来处理特定的功能,但现有工具可能无法满足这一需求。许多开发者希望能够在汇编中实现匿名段的功能,以提高代码的灵活性。我们建议开发一款支持匿名段的汇编工具,用户可以通过简单的设置实现匿名段的功能。这将大大提升开发者的工作效率,减少代码编写的复杂性。
证据信号
用户原话
Feature request: anonymous sections As discussed in #1120, and more recently in Discord `#asm-rgbds`, anonymous sections are a desirable feature that currently gets handled with macros. However, such macros are hard to write reliably, since `\@` is not unique across translation units, and we ended up rejecting #1460 as an alternative to `__FILE__`. The best we can currently do is to manually define a unique symbol per translation unit, which can be done automatically with build system cooperation, e.g. @ISSOtm's Makefile example: ```make obj/%.o: src/%.c rgbasm ${ASFLAGS} $< -o $@ -DUNIT_NAME='$*' # or ${*F} if you want just the file name. ``` ```asm MACRO ANON_SECTION SECTION "ANON {UNIT_NAME} \@", \# ENDM ``` This issue proposes to allow just omitting the section name. The resultin
intent: implement anonymous sections in assembly