私は GCC を初めて使用するので、インライン アセンブリ コードの問題に直面しています。UINT32
問題は、C 変数 (タイプは) の内容を registerにコピーする方法を理解できないことですeax
。以下のコードを試しました:
__asm__
(
// If the LSB of src is a 0, use ~src. Otherwise, use src.
"mov $src1, %eax;"
"and $1,%eax;"
"dec %eax;"
"xor $src2,%eax;"
// Find the number of zeros before the most significant one.
"mov $0x3F,%ecx;"
"bsr %eax, %eax;"
"cmove %ecx, %eax;"
"xor $0x1F,%eax;"
);
ただしmov $src1, %eax;
、機能しません。
誰かがこれに対する解決策を提案できますか?