News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Procedure Call Problem

Started by slash128gnr, October 02, 2010, 04:13:35 PM

Previous topic - Next topic

slash128gnr

I'm trying to write my own procedure call but when I go to link the file it says fatal error "LNK1120: 1 unresolved externals". I am new to masm so any help would be greatly appreciated.

.386
.model flat,stdcall
option casemap:none

include     \masm32\include\windows.inc
include     \masm32\include\kernel32.inc
include     \masm32\include\masm32.inc
include     \masm32\include\user32.inc
includelib  \masm32\lib\kernel32.lib
includelib  \masm32\lib\masm32.lib
includelib    \masm32\lib\user32.lib

isPrime PROTO :dword

.data?
buffer db 100 dup(?)
.code
start:
invoke isPrime, 322

END start

isPrime proc arg1:dword
    mov eax, arg1
    mov ebx, 4
    mov ecx, 5
    mov edx, 6
    Ret
isPrime endp

redskull

Your procedure is after the END statment; move the procedure between the .code directive and the start: label. Also, you may want to perform some sort of ExitProcess() call or 'ret' to keep it from crashing.

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

slash128gnr