flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Macro something like "MOV EAX, EXTEND_INT(0x1000)"

Author
Thread Post new topic Reply to topic
alorent



Joined: 05 Dec 2005
Posts: 221
alorent 20 Dec 2016, 12:00
Hi,

Is it possible to use a macro (or similar construction) inside an instruction? For example, imagine that I want to create a special value from a given integer. Example:

Code:
MOV EAX, MAKE_SPECIAL_INT(0x1000)
    


I have created something like:

Code:
macro MAKE_SPECIAL_INT value
{
    0xFFFF0000 + value
}
    


But FASM says "extra caracters on line". Is there any workaround to accomplish that?

Thanks!
Post 20 Dec 2016, 12:00
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20630
Location: In your JS exploiting you and your system
revolution 20 Dec 2016, 13:15
fasm doesn't support inline macros. You will need to override the MOV instruction and detect the special values inside that.
Post 20 Dec 2016, 13:15
View user's profile Send private message Visit poster's website Reply with quote
alorent



Joined: 05 Dec 2005
Posts: 221
alorent 20 Dec 2016, 17:43
Thanks revolution. No problem, I will use another workaround

Thanks!
Post 20 Dec 2016, 17:43
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.