Jump to a proc

Started by skirby, October 01, 2010, 03:05:23 PM

Previous topic - Next topic

skirby

Hello,

I would like to know if there is any way to make this code work?
It compile well on MASM v10 but I have the following error with POASM:
C:\Test\test.asm(15): error: Symbol 'Test2' is undefined.
C:\Test\test.asm(15): error: Symbol 'Test1.Test2' is undefined.

.386
.model flat, stdcall  ;32 bit memory model
option casemap :none  ;case sensitive

.data

.code

Test1   proc
    push    ebp
    mov     ebp, esp

    mov eax, 0

    jmp Test2

    leave
    retn
Test1   endp

Test2   proc
    push    ebp
    mov     ebp, esp

    mov eax, 1

    leave
    retn
Test2   endp

end


Thanks in advance and have a nice day.

TimoVJL

use Test2 proto before Test1 proc
May the source be with you

skirby

Hi timovjl and thanks a lot for your answer.
It works very well.

In fact, instead of declare the function Test2 before Test1, I have added the prototype of my 2 functions at the beginning of my code
proto Test1
proto Test2

Thanks again and have a nice day.