I am trying to use masm32 to learn about assembly. I am running Windows 8, and can compile and run sample code in the masm32 directory without issue.
I am using Quick Editor 4.0g.
However, I have the following code, straight from Kip Irvine's "Assembly Language for x86 Processors". He states that this is a bit of code that "does not depend on include files", though I am getting the sense that this may not be entirely correct.
TITLE Add and Subtract
; This program add and subtracts 32-bit Integers
.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
DumpRegs PROTO
.code
main PROC
mov eax,10000h
add eax,40000h
sub eax,20000h
call DumpRegs
INVOKE ExitProcess,0
main ENDP
END main
When I try to build it (I go to Project and choose "Console Assemble and Link") I get the following error:
AddSubAlt.obj : error LNK2001: unresolved external symbol _ExitProcess@4
AddSubAlt.obj : error LNK2001: unresolved external symbol _DumpRegs@0
AddSubAlt.exe : fatal error LNK1120: 2 unresolved externals
I have been trying to figure this out for days. I found an answer from 2002, but it references libraries that no longer exist. I am hoping that some assembly guru angel out there can help me fix this.
Please and thank you!
.lib
files to linker command line for the libraries you takeExitProcess
andDumpRegs
from. BTW, why callExitProcess
when you can just zeroeax
andretn
? – Ruslan