NO

Author Topic: Jump to a proc  (Read 4013 times)

skirby

  • Guest
Jump to a proc
« on: October 01, 2010, 03:05:23 PM »
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.

Code: [Select]
.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.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Jump to a proc
« Reply #1 on: October 01, 2010, 03:34:57 PM »
use Test2 proto before Test1 proc
May the source be with you

skirby

  • Guest
Re: Jump to a proc
« Reply #2 on: October 01, 2010, 04:37:14 PM »
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.