GBDK libraries documentation
PrevChapter 4. Assembly languageNext

Variables and registers

C normally expects registers to be preserved across a function call. However in this case as DE is used as the return value and HL is used for anything, only BC needs to be preserved.

Getting at C variables is slightly tricky due to how local variables are allocated on the stack. However you shouldn't be using the local variables of a calling function in any case. Global variables can be accessed by name by adding an underscore.

Calling conventionUpSegments