cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Assembly instruction in C

cosmapa2
Associate II
Posted on April 19, 2010 at 17:25

Conditional Assembly instruction in C

2 REPLIES 2
andrewpellett9
Associate II
Posted on May 17, 2011 at 13:47

I'm assuming you're using an stm32 processor, which only implements the Thumb-2 ISA (not Thumb or ARM).

Thumb-2 doesn't support conditional suffixes on all instructions, but it does give an IT instruction that can be used to subject the following instructions to conditional execution.

cosmapa2
Associate II
Posted on May 17, 2011 at 13:47

Thanks. I've been looking everywhere for detailed info and examples on how to use the IT instruction. Can someone please show how the 3-instruction sequence below must be rewritten using the IT instruction. 

   sub r0, r1, r0     

   movmi r0, #0

   movpl r0, #1