我正在尝试逐步执行 Visual Studio 2010 中的汇编函数,但每当调试器到达该ret
语句时,就会显示一个带有文本“无可用源”的窗口,然后调试器简单地退出程序。当包含函数调用时,甚至可以在 Visual Studio 调试器中运行 x86 汇编语言程序吗?
.686p
.model flat,stdcall
.stack 2048
.data
ExitProcess proto, exitcode:dword
.code
start:
jumpIfEqual PROC var1:DWORD, var2:DWORD, jmpAddress:DWORD
mov eax,var1
cmp eax,var2
jne skip
pop eax
push jmpAddress
skip:
ret ;this statement opens up a window in Visual Studio with the text "no source available", and then the program simply exits
jumpIfEqual ENDP
push OFFSET jumpIfEqual ;call the function
mov eax, 5 ;set the parameters for the function
push eax
push eax
call jumpIfEqual
invoke ExitProcess, 0
end start