Page 1 of 1

How to Jump to a memory address using ASM

Posted: Fri Aug 26, 2005 8:40 am
by A.I
Anybody who have knowledge on ASM?

I'm looking for a method to continue program execution from a label. Basically, I'm trying to do 'Goto' in ASM. I know this is done via !JMP, but it's not that simple. I'd like to Jump to a memory address defined by a variable. Like this:

Code: Select all

address = ?label ; PureBasic variable

!JMP [_address]

    ;This line will never be executed
label:
    ;The execution continues here
I know there's an alternative method by using the 'GotoEIP()' command from the OnError-library. However, I wonder which is faster since 'GotoEIP' has some CALLs in the ASM output.

Posted: Fri Aug 26, 2005 8:46 am
by DarkDragon

Code: Select all

address = ?label ; PureBasic variable

!JMP [v_address]

MessageRequester("Test", "1")
    ;This line will never be executed
label:
    ;The execution continues here
MessageRequester("Test", "2")
You have forgotten the v at v_adress.

Posted: Fri Aug 26, 2005 1:35 pm
by thefool
Notice you dont have to use the [v_value] unless you use the ! before.

Posted: Fri Aug 26, 2005 9:21 pm
by A.I
What?! The answer was that simple. *put his hand on his forehead*

Thankyou very much.