使用调用 DumpRegs 时出现 MASM32 错误

MASM32 error when I use call DumpRegs

所以我查看了该站点,但没有找到解决我的问题的方法。我尝试添加以下几行作为其他人问题的答案,但它对我不起作用。

includelib C:\full\path\to\Kernel32.Lib
includelib C:\full\path\to\User32.Lib
includelib C:\full\path\to\Irvine32.lib

; include C:\full\path\to\Irvine32.inc

这是我的全部代码。

includelib C:\Irvine\Irvine32.inc
includelib C:\Irvine\Kernel32.Lib
includelib C:\Irvine\User32.Lib
includelib C:\Irvine\Irvine32.lib

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



.data
    num BYTE 126d
    num2 SBYTE -26d
    num3 WORD   692Ah
    num4 SWORD -32789
    num5 DWORD 12345678h
    num6 SDWORD -2147483648

.code
main proc
    mov al, num
    call DumpRegs   ; I get the error when I put this in.

    mov ah, num2
    mov cx, num3
    mov dx, num4
    mov eax, num5
    mov ebx, num6


    invoke ExitProcess,0
main endp
end main

这是我得到的输出。

1>------ Build started: Project: Project, Configuration: Debug Win32 ------ 1> Assembling ..\ch03\AddTwo.asm... 1>..\ch03\AddTwo.asm(25): error A2006: undefined symbol : dumpRegs 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\masm.targets(50,5): error MSB3721: The command "ml.exe /c /nologo /Sg /WX /Zi /Fo"Debug\AddTwo.obj" /Fl"Project.lst" /I "c:\Irvine" /W3 /errorReport:prompt /Ta..\ch03\AddTwo.asm" exited with code 1. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

我的教授让我删除一些代码,所以这就是我剩下的

TITLE Add and Subtract          (AddSub.asm)

; This program adds and subtracts 32-bit integers.

INCLUDE Irvine32.inc

.data
    num BYTE 126d
    num2 SBYTE -26d
    num3 WORD   692Ah
    num4 SWORD -32789
    num5 DWORD 12345678h
    num6 SDWORD -2147483648

.code
main PROC

    mov al, num
    call DumpRegs

    mov ah, num2
    mov cx, num3
    mov dx, num4
    mov eax, num5
    mov ebx, num6

    exit
main ENDP
END main

我的代码有效。

他叫我不要用

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

在我们节目的开头。或者

invoke ExitProcess,0

最后。

您没有包括足够的库或正确的库! 包含行中的错误。

;includelib C:\masm615\Irvine\Irvine32.inc;
;includelib C:\masm615\Irvine\Kernel32.Lib;
;includelib C:\masm615\Irvine\User32.Lib;
;includelib C:\masm615\Irvine\Irvine32.lib;
Include irvine32.inc ;this will include them all;
.386;
.model flat,stdcall;
.stack 4096 ExitProcess proto,dwExitCode:dword;
;
.data ;

num BYTE 126d;
num2 SBYTE -26d;
num3 WORD 692Ah;
num4 SWORD -32789;
num5 DWORD 12345678h;
num6 SDWORD -2147483648;
;
.code;
main proc;
mov al, num;
call DumpRegs ; I get the error when I put this in.;
mov ah, num2;
mov cx, num3;
mov dx, num4;
mov eax, num5;
mov ebx, num6;
;
invoke ExitProcess,0;
main endp;
end main;