flat assembler
Message board for the users of flat assembler.

Index > 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
pepe 22 Dec 2017, 14:27
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: 19252
Location: In your JS exploiting you and your system
revolution 22 Dec 2017, 15:08
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
pepe 22 Dec 2017, 18:27
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


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

Website powered by rwasa.