GBDKライブラリドキュメント
GBDK libraries documentation

Prev
4章 アセンブリ言語
Chapter 4.Assembly language

Next

変数とレジスタ
Variables and registers

Cは、通常レジスタが関数呼び出しを横切って保存されることを予期します。 DEが返り値として使用され、HLが何でものために使用されるとともに、しかしながら、この場合、BCだけを保存する必要があります。
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.

C変数を手に入れることは、ローカル変数がスタックにどう割り付けられるかによりわずかに巧妙です。 しかしながら、呼び出し関数のローカル変数をどんな場合も使用してはなりません。 グローバル変数は下線を加えることによって名前でアクセスできます。
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.



Prev
ホーム
Home

Next
協定を呼ぶこと
Calling convention

Up
セグメント
Segments
 1