ARM Assembler - Jak korzystać z CMP, BLT i BGT?

Szybkie pytanie dla was, w mojej pętli muszę użyć CMP, BLT i BGT, aby porównać niektóre wartości. Jak używać wspomnianych instrukcji w następującej pętli?

Próbuję używać BGT, BLT i CMP, ponieważ potrzebuję ich, aby moja aplikacja działała. Problem polega na tym, że nie mam pojęcia, jak z nich korzystać. Jeśli chciałbym użyć CMP do porównania r6 z r4 i umieścić różnicę w r7, jak mam to zrobić? To samo pytanie, czy chciałbym użyć BLT, jeśli r7 jest mniejsze niż 0, jak bym to zrobił?

  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

Oto moja cała pętla:

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

questionAnswers(3)

yourAnswerToTheQuestion