推送无效指令操作数

时间:2017-11-20 21:50:54

标签: assembly x86 x86-64

我试图在一些操作后返回数字,但编译器返回 push esp push num pop esp pop num 无效的指令操作数,虽然MASM 允许push {register} 。它使用Visual Studio(调试模式x64)在x64,MASM上运行。怎么了?

PUBLIC from_asm
EXTERN puts:PROC
EXTERN exit:PROC

.data
   num dd ?

.code

from_asm PROC

mov EAX, not -30
or EAX,21
mov EBX, not 21
and EAX, EBX
or EAX, 23

mov num, eax
mov esp, dword ptr [num]
push esp
push num
call puts
pop num 
pop esp

ret

from_asm ENDP

END

P.S。我检查过,在所有操作 EAX num 包含数字31之后。

0 个答案:

没有答案