I am trying to return the number after some operations, but compiler returns push esp, push num, pop esp, pop num invalid instruction operands, although MASM allows push {register}. It's runing on x64, MASM, with Visual Studio (Debug mode x64). What's wrong?
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. I checked, that after all operations EAX and num contains number 31.