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

Prev
2章 ターゲットとしてのGameboy
Chapter 2.The Gameboy as a Target

Next

その他
Other

できれば、>、<、<=、>=よりも均等演算子==と不平等演算子!=を使用してください。 オペランドが符号付きかlongの場合、その後不平等のためのコード、著しくより複雑、そのとき2つのオペレーションで行うことができる符号なしのバイトで。
Preferably use the equality operators == and != over the inequality operators >, <, <= and =>.If the operands are signed or long then the code for inequality significantly more complex then for unsigned bytes which can be done in two operations.

それらが宣言した時(例えばint i=0)、初期化されます、グローバル変数は、lccによって_DATAセグメントの中に入れられます。 これは次のことを意味します、可変隠語_DATAセグメントがあるGBに関しては変更される、ROM。 これを回避するために、その最上、それらを宣言した後に任意のグローバル変数を初期化するために、つまり、使用します。
Global variables that are initialised when they declared (for example int i = 0;) are put into the _DATA segment by lcc.This means that the variable cant be changed as for the GB the _DATA segment is in ROM.To avoid this, its best to initialise any global variables after declaring them i.e. use

int i;
int main(void)
{
    i = 0;
};
上記のコードの代わりに。
instead of the above code.



Prev
ホーム
Home

Next
グローバル変数の使用
Using global variables

Up
ハードウェアへのアクセス
Accessing hardware
 1