以下语法是哪种汇编语言?
Which assembler dialect is the following syntax?
and dword ptr [edi], not (1 shl 2)
您是否介意指出描述此方言的文献 and/or 在其他方言中提供相同的语法?对这条线的解释对我自己的启发也很有帮助。
FWIW,我正在尝试将此方言中的指令移植到我认为使用 GNU 方言的 coreboot。当我尝试 assemble 不更改此指令时,我从 i386-elf-gcc 收到以下错误:
./src/drivers/intel/fsp/cache_as_ram.inc: Assembler messages:
./src/drivers/intel/fsp/cache_as_ram.inc:74: Error: junk `PTR [edi]' after expression
./src/drivers/intel/fsp/cache_as_ram.inc:74: Error: too many memory references for `and'
Microsoft 宏汇编程序 (ml.exe) [也称为 MASM 或 MASM32] 理解此构造。
等于:
and dword ptr [edi], 0fffffffbh
如何?
1 shl 2
等于 4(您将 1 向左移动两个位置:100
在基数 2 或 4
在基数 10)
因此我们有not 4
(您将基数 2 中的 100 中的所有位取反)
以 2 为基数给出 11111111111111111111111111111011
(我们在 32 位上)
这等于 0fffffffbh
(0x0fffffffb ;4294967291
十进制)
and dword ptr [edi], not (1 shl 2)
您是否介意指出描述此方言的文献 and/or 在其他方言中提供相同的语法?对这条线的解释对我自己的启发也很有帮助。
FWIW,我正在尝试将此方言中的指令移植到我认为使用 GNU 方言的 coreboot。当我尝试 assemble 不更改此指令时,我从 i386-elf-gcc 收到以下错误:
./src/drivers/intel/fsp/cache_as_ram.inc: Assembler messages:
./src/drivers/intel/fsp/cache_as_ram.inc:74: Error: junk `PTR [edi]' after expression
./src/drivers/intel/fsp/cache_as_ram.inc:74: Error: too many memory references for `and'
Microsoft 宏汇编程序 (ml.exe) [也称为 MASM 或 MASM32] 理解此构造。
等于:
and dword ptr [edi], 0fffffffbh
如何?
1 shl 2
等于 4(您将 1 向左移动两个位置:100
在基数 2 或4
在基数 10)因此我们有
not 4
(您将基数 2 中的 100 中的所有位取反)以 2 为基数给出
11111111111111111111111111111011
(我们在 32 位上)这等于
0fffffffbh
(0x0fffffffb ;4294967291
十进制)