0

I installed SimpleASM and MASM32 to learn assembly. I am now reading a book and try the code written in it.

; AddTwo.asm - adds two 32-bit integers
; Chapter 3 example

.386
.model flat,stdcall
.stack 4096
ExitProcess PROTO, dwExitCode: DWORD

.code
main PROC
mov eax, 5     ; move 5 to the eax register
add eax,6     ; add 6 to the eax register

INVOKE    ExitProcess,0
main ENDP
END main

but when i try to build the code, this is it what the console says

[17:56:02] Warning! Errors have occurred in the build:
program.o : error LNK2001: unresolved external symbol _ExitProcess@4
C:\Users\De\AppData\Local\Temp\SASM\SASMprog.exe : fatal error LNK1120: 1 unresolved externals

edit:

while i extract the masm32. in the cmd part it says

"inc2l.exe - Ordinal Not Found"
"The ordinal 203 could not be located in the dynamic link library
WINSPOOL.DRV." 

i just ignore it.. and it keeps showing.. i just pressing enter until the assembly is installed

Vitas
  • 149
  • 13
  • You forgot to link with kernel32? – Jester Nov 24 '17 at 14:48
  • while i extract the masm32. in the cmd part it says "inc2l.exe - Ordinal Not Found" "The ordinal 203 could not be located in the dynamic link library WINSPOOL.DRV." i just ignore it.. and it keeps showing.. i just pressing enter until the assembly is installed – Vitas Nov 25 '17 at 00:45
  • If you are getting that WINSPOOL error I suggest you reinstall MASM32 with your Anti Virus software turned off. Then turn on the Av sofwtare when complete. – Michael Petch Nov 25 '17 at 01:20
  • oh.. i see.. i don't have any AV.. maybe the windows defender? my computer also has virus... maybe virus affects it?? the first time i installed masm32.. it says nothing... but i deleted it and reinstall it.. and now it says inc2l.exe - ordinal not found... ill try to reinstall it now.. – Vitas Nov 25 '17 at 01:27
  • i already fixed the WINSPOOL error but still the LNK2001 error is happening. – Vitas Nov 25 '17 at 01:55
  • Jester gave you a hint in his first comment. – Michael Petch Nov 25 '17 at 06:09
  • how to link with kernel32? – Vitas Nov 25 '17 at 07:53

0 Answers0