Why "jmp 100" can't assemble? Sometimes I just don't want to specify a label, or I can't make a label at a certain address e.g. in a loaded dll.

Still I think I can


mov eax, 100
jmp eax

but I want no redundance.

How would you do, if you need jump to 00400000h (although there's unlikely any code at 00400000h) ?:stupid:
Posted on 2002-05-11 22:32:03 by C.Z.
Come on bomb01. You just asked two questions in 15 minutes. Sorry be telling you this, but do you think you can learn assembly in a day? If you like it, practise, google around, use the Posted on 2002-05-11 22:52:39 by CodeLover
I know, but I've been thinking hard about it. I checked the manuals shipped with masm package all over, and when searching on google you know it's hard to pick out the real useful info. And I don't think it's a problem for you gurus here to write a small piece of help for a beginner in asm like me.

Anyway I didn't know there's the Posted on 2002-05-11 23:11:05 by C.Z.
How would you do, if you need jump to 00400000h (although there's unlikely any code at 00400000h)



mov eax, 400000h
jmp dword ptr [eax]
Posted on 2002-05-11 23:58:13 by sluggy




mov eax, 400000h
jmp dword ptr [eax]


sluggy, I think you got me wrong. Your code jumps to the address which the dword at 400000h points to.
Posted on 2002-05-12 00:51:42 by C.Z.
Search Tip: "beginner" ;)

As for tut's, see Thomas' intro to asm tut's they come hightly recomended from what i keep hearing. www.madwizard.org

Also, there is a decient amount of recient stuff being discussed for "Chalain" (Search tip #2). We threw him alot of beginner stuff to work with, and he began to write begginer code, which we could *then* help critique for him. This is the best approach you can expect really from us "guru's".

Another fairly new person to follow, and pick up past suggestions from is "Quages" <- Search Tip #3. He has amounted a fair bit of basic questions concerning assembly that may help you learn from.

There are other new here too. So read, search, and heed to Code Lovers advice and be ready to put in the long haul. It will pay off, and we will be more than williing to help you when your stumped ;) To be honest, i think i learned the most not by asking questions so much, but reading the questions that others *have* asked....

Good Luck..
:alright:
NaN
Posted on 2002-05-12 02:29:38 by NaN
NaN,
I searched for "beginner" and did not get what I want !!!
I searched for questions from Qage and Chalain and did not get what I want !!!
I read Thomas's tutorials and did not get what I want !!!

dunno what you suggested his tutorials for? I'm quite a newbie in asm but not in win32 programming. I'd like you to answer my question as originally posted if you can.

Plus, you mentioned you learned the most not by asking questions. So do I.:tongue: Still I have questions I can't solve myself.
Posted on 2002-05-12 03:58:07 by C.Z.
Immediate works for relative offset only, you must a register or a memory location to jump to an absolute offset. Read Intel manual vol. 2 for more info.
Posted on 2002-05-12 05:49:58 by Dr. Manhattan
Then you want the AoA 16 (Art of Assembly language, online book) Seach tip #4.

Read it. And when you want to optomize look up Agner Fog's site for optomization tut's. (Search tip #5)

I dont have either link off hand.
:NaN:
Posted on 2002-05-12 13:30:16 by NaN
I'm afraid there's no way to do this in masm - I thought I had it
working some time ago, but seems like that was something else :).
It isn't even possible to hand-code the jmp, as masm bitches about
"error A2094: operand must be relocatable". If you need this for
"jmp OEP" in a packer/crypter, you could always make the packer/crypter
fix up the jmp. Dunno how to handle it in masm, sorry.
Posted on 2002-05-12 13:52:00 by f0dder
Just transfer it through a register like normal.


mov eax, 4198400
jmp eax

This piece of code jumps back to the "start" label in the test prog. The hard coded address was calculated with LEA EAX, start, then written as is in the code.

What is the big deal about ?

Regards,

hutch@movsd.com
Posted on 2002-05-12 19:34:45 by hutch--
Thanks for the replies but it seems to me the masm assembler is limited at this aspect.

hutch, it's no big deal but I would not consider masm an ideal assembler because of this.:(
Posted on 2002-05-12 23:10:19 by C.Z.


Posted on 2002-05-13 04:47:02 by Maverick
Will hutch be sad? :rolleyes:
Posted on 2002-05-13 04:55:57 by C.Z.
Probably, and I'm sorry about it, but, hell, we've to move on with times, nothing can tie us to the past. ;)

He will be the n.1 hoster of FASM, and will thus finish all his problems of bandwidth. :grin:
Posted on 2002-05-13 05:08:01 by Maverick