title: point of IT instruction ARM assembly
body: <p>I've got the following ARM assembly code.</p>
  
  <pre><code>CMP             R0, #0
  ITT EQ
  MOVEQ           R0, #0x7FFFFFFF
  BXEQ            LR
  </code></pre>
  
  <p>Firstly, why is the EQ needed after the MOV and BX instructions? The <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/Cjaghefc.html">ARM reference</a> says that the condition (EQ) after the ITT will be applied to the first instruction (MOV) in the IT block and then because of the second T in ITT the EQ will be applied to the second instruction (BX) in the IT block. So if the ITT is applying the EQ, why is the EQ needed in MOVEQ and BXEQ?</p>
  
  <p>Secondly, why is the IT instruction needed at all? Why not just have:</p>
  
  <pre><code>CMP             R0, #0
  MOVEQ           R0, #0x7FFFFFFF
  BXEQ            LR
  </code></pre>
  
  <p>It's MOV not MOVS so the flags won't be updated and the EQ in BXEQ will still be "referring" to the flag values set by the CMP.</p>