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 > Non-x86 architectures > fasmarm: how to determine proc state in a macro

Author
Thread Post new topic Reply to topic
pepe



Joined: 26 Feb 2015
Posts: 9

fasmarm: how to determine proc state in a macro

Hello,

i need to make conditional assembly in a macro depending on the current processor state (thumb or arm). How can i detect it in the macro?
tried to search the forum but i could find hardly anything related...

thank you,
pepe
Post 22 Dec 2017, 14:27
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15636
Location: Thasus

You can use virtual to determine the output code size:

Code:
virtual
        nop
        mode@CPU = $-$$
end virtual
;...
if mode@CPU = 2
        ;thumb code
else
        ;Aarch32 or Aarch64 code
end if

Post 22 Dec 2017, 15:08
View user's profile Send private message Visit poster's website Reply with quote
pepe



Joined: 26 Feb 2015
Posts: 9

nice, thank you!

and happy Christmas to all Smile

pepe
Post 22 Dec 2017, 18:27
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


Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2018, Tomasz Grysztar.
Powered by rwasa.