Hi !

With the JMP-command only provide a small jump range.

Is it possble to jump over thousands lines ?
Posted on 2003-03-15 17:09:12 by Forginforcer

Wow.. wouldn't you feel dizzy after such a long jump? :grin:

Anyway, from the 80386 on, there are 32 bit forms of JMP, that means "jump anywhere".

/me exploits the suggestion and puts the "1984" CD, to listen to Van Halen - Jump :cool:
the '80s still rule :)
Posted on 2003-03-15 17:21:55 by Maverick
Yep. You must specify the instruction size when assembling (e.g. JMP SHORT or JMP NEAR) since it isn't obvious.
JMP NEAR is encoded as E9 followed by a 16 or 32 bit displacement.
Posted on 2003-03-15 17:27:39 by Sephiroth3

Yep. You must specify the instruction size when assembling (e.g. JMP SHORT or JMP NEAR) since it isn't obvious.
JMP NEAR is encoded as E9 followed by a 16 or 32 bit displacement.

Not in MASM, it will figure it out itself.

Posted on 2003-03-16 03:16:13 by Thomas
@Maverick, ultra-funny :grin::alright: :grin: :grin:

The command "JMP FAR PTR @marke" is useable.

I have the each jmp command and the mark in a diffrent file. But in the main file I included both.
The compiler says the mark isnt dinfnet.

What should I do ?

Greets Red Forginforcer
Posted on 2003-03-16 03:21:30 by Forginforcer
The compiler is complaining because you've got a lable that isn't defined....
All you need to do is tell it that it is external to that bit of code, this means that the compiler will leave it up to the linker to sort it out. This is the same as when linking to static libs, as the code doesn't exist within the block you are writing, the compiler needs to know it exists, so you just tell it "trust me its there, I'll give it to you later when you link it"

Look at extern in the masm32 help file.

Posted on 2003-03-16 06:31:04 by Mirno
Hi !
Now I know how to define an extern variable, bur a mark, i cand define extern.
Can someone help me ? - What the heck means language type ? - what I need do code, if i use masm ?

ultra-greets Red Forginforcer
Posted on 2003-03-16 06:52:50 by Forginforcer
There is no difference between a label and a variable.

A variable is just saying that "some data starts here". How you use the data is up to you, it could be code, it could be text, it could be a 16 bit number, a 32 bit number, or a pointer to something else. Its just a label.
This is why you can "mov offset MyFunc", because a function is just a label, and a number of arguments associated with calling it.

Posted on 2003-03-16 07:24:33 by Mirno
You're right.
Wich datatype I have ti use then ?

Even if the makr and the jmp command are in the same file it doesnt work.
Perhaps its has to do, that the makr is in another funktion ???
Posted on 2003-03-16 07:27:39 by Forginforcer
Oh ! - Its, becaue in the label only a local mark !
Its possbile to create a global mark(or label) ???
Posted on 2003-03-16 08:46:34 by Forginforcer
Jumping into another function is almost always bad. Are you sure that's what you want?

Posted on 2003-03-16 09:07:56 by Thomas
Hello Thomas,
I want to send a message, so i can simulate a button click.
But I want to make that from an other funktion/lable.

Winrpoc ...

winproc ENDP


//from here i want to to realize that the button get a simulated click

Thanks !
Posted on 2003-03-16 09:13:18 by Forginforcer
IIRC one colon for local label, two for global -

Posted on 2003-03-16 11:54:48 by Mirno
ultraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa !
many thanks !
Thanks for your attention !

Ultra greets Red Forginforcer !

I own you much !
Posted on 2003-03-16 12:37:06 by Forginforcer
EDIT: I just saw you didn't compile your files seperately so all the following stuff doesn't matter. Well this how to do it with multiple files:

The only way I found to jump to code in another file without producing an indirect call (ie. jmp testLabel instead of jmp dword ptr ) is this:

public testLabel

; your code


testLabel proto C

jmp testLabel

In 2.asm, MASM thinks testLabel is a C function with no parameters (it isn't but that doesn't matter). Now the jump will go to the right address. There might be a more cleaner way to do this but I don't know of it (never used jumps accross files).

Posted on 2003-03-16 12:38:19 by Thomas
Thanks Thomas and all other guys in this Forum !

Thats also helpful !

Thanks !
Posted on 2003-03-16 12:48:53 by Forginforcer