flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Macroinstructions > Macro something like "MOV EAX, EXTEND_INT(0x1000)"

Author
Thread Post new topic Reply to topic
alorent



Joined: 05 Dec 2005
Posts: 196
Macro something like "MOV EAX, EXTEND_INT(0x1000)"
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 EAXMAKE_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: 14586
Location: Planet Dirt
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: 196
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.