我正在尝试在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