调试器总是在第二个过程中引发错误

时间:2019-04-15 02:35:34

标签: visual-studio assembly x86 masm subroutine

我正在尝试调试程序,以便解决硬件问题。硬件问题与该问题无关,因为我通过2个单独的程序对其进行了测试。

基本上,当我尝试调试时,可以在第一个过程中设置一个断点,它将正常工作。

第二个过程的断点将出现错误。

代码可以很好地编译。

该代码仅适用于一个过程,并且我已经测试了基本过程。

INCLUDE Irvine32.inc
.386
.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword

.data
    myString BYTE "Hello World",0dh,0ah

.code
main proc

    ;------DigitValue2ASCII-----
DigitValue2ASCII proc
    mov eax, 0000h
    mov edx, 0ch 
    mov al, 00h
    cmp dl, 0ah
    jae letter
    cmp dl, 0ah
    jb number
    letter: add dl, 37h
    jmp final
    number: add dl, 30h
    final: mov al, dl
    call writechar

    mov eax, 0000h
    mov edx, 09h
    mov al, 00h
    cmp dl, 0ah
    jae letter1
    cmp dl, 0ah
    jb number1
    letter1: add dl, 37h
    jmp final1
    number1: add dl, 30h
    final1: mov al, dl
    call writechar

    ret
DigitValue2ASCII endp

WriteHexByte proc
    mov eax, 00h
    ret
WriteHexByte endp



call DigitValue2ASCII   


invoke ExitProcess,0
main endp
end main

错误

'Project.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. Symbols loaded.
'Project.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Symbols loaded.
The thread 0x2cd0 has exited with code 0 (0x0).
The thread 0x4f7c has exited with code 0 (0x0).
The thread 0x13a4 has exited with code 0 (0x0).
The program '[18384] Project.exe' has exited with code 57 (0x39).```

1 个答案:

答案 0 :(得分:0)

我不得不将过程移至main endp下面,而不是移至main procmain endp之间