Ensamblador ARM - ¿Cómo uso CMP, BLT y BGT?
Pregunta rápida para ustedes, en mi bucle necesito usar CMP, BLT y BGT para comparar algunos valores. ¿Cómo utilizarían dichas instrucciones en el siguiente bucle?
Estoy tratando de usar BGT, BLT y CMP ya que los necesito para hacer que mi aplicación funcione. El problema es que no tengo idea de cómo usarlos. Si quisiera usar CMP para comparar r6, con r4 y poner la diferencia en r7, ¿cómo haría esto? La misma pregunta si quisiera usar BLT si r7 es menor que 0, ¿cómo haría esto?
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
Aquí está mi bucle completo:
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