mov, eax 12345
以降のmov var, eax
(varが32bit int等の場合)、var
を出力すると正しく出力されます。私はmovをeax、axに入れることはできますが、alに入れることはできません。
ax
と同じです。 mov ax, 65535
- >mov var16, ax
が正しく出力されます。
しかし、mov
をal
に、またはah
に入力しても、出力されません。
おそらくah
に移動すると意味がありません。しかし、なぜそれは両方のためにそうですか?
typedef int int32;
typedef unsigned char int8;
typedef short int16;
int _tmain(int argc, _TCHAR* argv[])
{
int8 c1 = 0;
int8 c2 = 0;
__asm
{
mov al, 255
mov c1, al
}
cout << c1 << endl; //outputs nothing, same if I used ah
//whereas
int32 n = 0;
__asm
{
mov eax, 10000
mov n, eax
}
cout << n << endl; // works fine, well, you get the picture
return 0;
}
8ビットの符号なしバイトの最大値は255(ゼロベース)です。 –
8ビット変数の場合、256が大きすぎることに注意してください。 – fuz
「AX」と同じ範囲エラーがあります。 'WORD'は0..65535と_not_65536の範囲を持っています。 – zx485