Assembly NESASM-内联方法跳转

Assembly NESASM-内联方法跳转,assembly,methods,Assembly,Methods,是否可以在nesasm中进行内联“方法”跳转(或在nesasm中可能工作的任何asm) 我的意思是: 我有这样的代码 Start; LDA $0000 ; here goes more code JSR SomeMethod ; jump to method (put back pointer on stack) EndOfMethod: ; just help label to make code more clear STA $0000 ; here

是否可以在nesasm中进行内联“方法”跳转(或在nesasm中可能工作的任何asm)

我的意思是: 我有这样的代码

Start;
    LDA $0000
    ; here goes more code
    JSR SomeMethod ; jump to method (put back pointer on stack)
EndOfMethod: ; just help label to make code more clear
    STA $0000
    ; here goes a lot of more code
SomeMethod:
    TAX
    ;here goes more method code
    RTS ; return to position on stack
现在我想让“SomeMethod”内联(就像在C++中),这样编译时它会像这样:

Start;
    LDA $0000
    ; here goes more code
SomeMethod:
    TAX
    ;here goes more method code
EndOfMethod: ; just help label to make code more clear
    STA $0000
    ; here goes a lot of more code
不,在汇编语言中,您是编译器。您可以完全控制使用的所有说明,但也要承担所有责任

汇编程序只是将指令从文本文件翻译成二进制指令。

不,在汇编语言中,您就是编译器。您可以完全控制使用的所有说明,但也要承担所有责任


汇编程序只是将指令从文本文件转换为二进制指令。

如果汇编程序支持某种类型的宏,特别是带有参数的宏,则可以将
SomeMethod
定义为宏,并使用参数使每个实例都有自己的一组标签(通过将参数合并到标签名称中)

比如:

defMacro SomeMethodMacro(idx):
SomeMethod$idx:
    TAX
    ;code...
EndOfMethod$idx:
endMacro
然后,当您想在代码中粘贴实例时:

SomeMethodMacro(001)

您将负责确保每个实例都有不同的参数。

如果您的汇编程序支持某种类型的宏,特别是一个带参数的宏,那么您可以将
SomeMethod
定义为宏,并使用参数使每个实例都有自己的一组标签(通过将参数合并到标签名称中)

比如:

defMacro SomeMethodMacro(idx):
SomeMethod$idx:
    TAX
    ;code...
EndOfMethod$idx:
endMacro
然后,当您想在代码中粘贴实例时:

SomeMethodMacro(001)

您负责确保每个实例都有不同的参数。

Thx,现在我知道我在搜索什么,并找到了:)Thx,现在我知道我在搜索什么,并找到了:)