title: ARM Assembler - How do I use CMP, BLT and BGT?
body: <p>Quick question for you guys, in my loop I need to use CMP , BLT and BGT to compare some values. How would use said instructions in the following loop?</p>
  
  <p>I'm trying to use BGT , BLT and CMP as I need them to make my application work. The trouble is I have no idea how to use them. If I wanted to use CMP to compare r6, with r4 and put the difference into r7, how would I do this? The same question if I wanted to use BLT if r7 is less than 0, how would I do this?</p>
  
  <pre><code>  BGT ??????? ; branch if greater than 5
    CMP ???????? ; compare r6 with r4 , put difference into r7
    BLT ???????? ;branch if r7 is less than 0
    BGT ???????? ;branch if r7 is greater than 0
  </code></pre>
  
  <p>Here's my entire loop:</p>
  
  <pre><code>LoopStart
  
    BL WaitBUT1
    BL readTemp
    BL checkTemp
    BGT ??????? ; branch if greater than 5
    BL errorVal
    CMP ???????? ; compare r6 with r4 , put difference into r7
    BLT ???????? ;branch if r7 is less than 0
    BL FanOn
    BL errorLedOn
    BL systemLedOn
    BL heaterOn
    BGT ???????? ;branch if r7 is greater than 0
    BL FanOff
    BL errorLedOff
    BL systemLedOff
    BL heaterOff
    BL WaitBUT2
    BL FanOff
    BL errorLedOff
    BL systemLedOff
    BL heaterOff
  
    B LoopStart
  </code></pre>