What use of 'AL condition' in ARM IT block?

Hi,

I read the following on IT block in ARM Thumb2 instruction. I don't understand the last sentence on AL to get the changed behavior.

Could you explain it to me?

Thanks,

///////////// A8.6.50 IT If Then makes up to four following instructions (the IT block) conditional. The conditions for the instructions in the IT block can be the same, or some of them can be the inverse of others.

IT does not affect the condition code flags. Branches to any instruction in the IT block are not permitted, apart from those performed by exception returns.

16-bit instructions in the IT block, other than CMP, CMN and TST, do not set the condition code flags. The AL condition can be specified to get this changed behavior without conditional execution.
Reply to
Robert Willy
Loading thread data ...

The IT (ITT/ITE) instruction is followed by a condition. The AL (ALways) condition is always true. Thus an "IT AL" instruction commences a sequence of four instructions which are always executed (use of the E (Else) flag is prohibited when the condition is AL).

Most 16-bit instructions set the condition code flags based upon the result (e.g. the Z flag will be set if the result is zero). 32-bit instructions have an optional S flag to control whether flags are affected.

But instructions which are part of an IT block (even one with the AL condition) don't set the condition code flags unless the instruction is CMP, CMN or TST.

The term "changed behaviour" refers to not setting the flags.

Reply to
Nobody

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.