flat assembler
Message board for the users of flat assembler.

Index > Non-x86 architectures > [fasmarm] CPU capability 5T

Author
Thread Post new topic Reply to topic
Asvald



Joined: 11 Jun 2014
Posts: 2
Asvald 11 Jun 2014, 08:05
Hi dudes! Can you ask me, why i can't compile this code for CPU_CAPABILITY_V5T (if uncomment processor 1 shl 09), but for CPU_CAPABILITY_V4T code is compiled perfectly. And how can i do it in fasm for 5T?
Error: Requires CPU capability 7M, use directive "processor" to select.

Code:
 format ELF executable
        entry start
        segment readable executable

       code16
       processor 1 shl 07       ;CPU_CAPABILITY_V4T
       ;processor 1 shl 09       ;CPU_CAPABILITY_V5T
start:
       LDRB    R0, [R6]
       LDR     R1, [R7,#4]
       ADDS    R6, #1
       STRB    R0, [R1]
       ADDS    R1, #1
       STR     R1, [R7,#4]    
Post 11 Jun 2014, 08:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20298
Location: In your JS exploiting you and your system
revolution 11 Jun 2014, 08:33
You need to combine the capability bits. V5T only gives the extra V5T instructions provided, it does not enable all the previous version instructions.

So if your CPU can do all of V1 through to V5T but nothing higher then you should enable all of the V1 to V5T bits but not any others.
Post 11 Jun 2014, 08:33
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20298
Location: In your JS exploiting you and your system
revolution 11 Jun 2014, 08:38
Note that V5T only provides the following two instructions:
bkpt imm
blx reg

You can see this in the file "InstructionFormatsTHUMB16.asm". So things like ADD are not available without enabling the other instruction sets.
Post 11 Jun 2014, 08:38
View user's profile Send private message Visit poster's website Reply with quote
Asvald



Joined: 11 Jun 2014
Posts: 2
Asvald 11 Jun 2014, 11:22
Thanks revolution! But can you explain me, why there is only blx reg, but what about "blx addr".
Post 11 Jun 2014, 11:22
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20298
Location: In your JS exploiting you and your system
revolution 11 Jun 2014, 11:36
"blx offset" is available in V5 ARM mode and X capability THUMB mode. Have a look at the InstructionFormatsARM.asm and InstructionFormatsTHUMB32.asm files to see BLX used there.
Post 11 Jun 2014, 11:36
View user's profile Send private message Visit poster's website 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.