0
我花了很多時間試圖解決這個問題,我不明白,爲什麼它不工作。問題的描述是在下面的評論:註冊ESI導致RunTime-Check失敗#0錯誤
.386 .MODEL FLAT, STDCALL OPTION CASEMAP:NONE .NOLIST .NOCREF INCLUDE \masm32\include\windows.inc .LIST .CODE DllEntry PROC hInstDLL:HINSTANCE, reason:DWORD, reserved1:DWORD mov eax, TRUE ret DllEntry ENDP caesarAsm proc string: DWORD, key: DWORD, stringLength : DWORD mov esi, 1 ; I cannot use this register, mov esi, (anything) causes Crash: ; Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention mov eax, string ret caesarAsm endp END DllEntry
我搜索「整」的互聯網,我發現問題與堆棧連接,但沒有堆棧操作幫我解決這個問題。 我正在使用Microsoft Visual Studio 2012
https://en.wikipedia.org/wiki/X86_calling_conventions#Register_preservation –