flat assembler
Message board for the users of flat assembler.
Index
> Non-x86 architectures > [fasmarm] Automatic ITE blocks... |
Author |
|
revolution 26 Feb 2015, 15:18
If you don't want IT instructions in THUMB mode than you can use the wide (.w) versions. But this will increase the code size. Note: that fasmarm only inserts IT instructions when it is forced to because of a condition code or if there is a saving in code size.
The presence of IT in the above example gives you a smaller code footprint than if the wide version of each instruction was used. The reason for the ITTTT AL is because there are no short 16-bit versions of the instructions you used. The 16-bit opcodes are very limited and many of the arithmetic instructions always update the flags so using an "ITTTT AL" wrapper instruction allows the following instructions to not set the flags. It is a trick used to get smaller code. |
|||
26 Feb 2015, 15:18 |
|
pepe 26 Feb 2015, 16:11
Hey, thanks for the quick reply.
Now i seem to get it. So if i used MOVS and SUBS, the ITTTT AL could be avoided. great idea, thanks for the explanation. pepe |
|||
26 Feb 2015, 16:11 |
|
revolution 26 Feb 2015, 16:15
pepe wrote: Now i seem to get it. So if i used MOVS and SUBS, the ITTTT AL could be avoided. Also note the existence and differences between UAL (THUMB) and pre-UAL (CODE16) modes. The pre-UAL is quite confusing with the removal of the 'S' in only some of the thumb instruction opcodes. I recommend not using pre-UAL opcodes unless you have old code you are supporting. |
|||
26 Feb 2015, 16:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.