ML - sar,shl (?) 上的无效指令操作数

ML - invalid instruction operands on sar,shl (?)

获取 "error A2070: invalid instruction operands" 汇编代码中的以下指令(从 CL 生成)

mov edx, DWORD PTR ?_Var2@@3JA      
shl edx, 1326   ;this line gets the error

mov ecx, DWORD PTR ?_Var3@@3JA
shl ecx, 1514   ;this line gets the error

mov ecx, DWORD PTR __Var4314[ebp]
sar ecx, 3811   ;this line gets the error       

这里没有发生:

; Line 698
movsx   edx, BYTE PTR ?_Var5@@3PAHA+4
movsx   ecx, BYTE PTR ?_Var6@@3PADA+1
sar edx, cl

也许与 shl,sar 与常量而不是寄存器一起使用这一事实有关? 困惑:(

因为edx等寄存器都是32位大小的,移动超过32位就没有意义了。这就是汇编程序出错的原因。