Problem with assembly programming and Procedure calls
I am using MASM 开发者_运维问答to do some assembly programming. When I try to run my program it crashes immediately when it encounters "call myFunction", even after I've stripped out all the code from the procedure. Here is my code any help would be greatly appreciated.
.486
.model flat
.stack 100h
ExitProcess PROTO NEAR32 stdcall, dExitCode:DWORD
.code
_start:
call myFunction
INVOKE ExitProcess,0
PUBLIC _start
myFunction proc near32
myFunction endp
END
Change myFunction to
myFunction proc near32
ret
myFunction endp
to make it a stub. In your version, it has no instructions, so it executes whatever follows it in memory.
精彩评论