Domanda veloce per voi ragazzi, nel mio ciclo ho bisogno di usare CMP, BLT e BGT per confrontare alcuni valori. Come utilizzerebbero dette istruzioni nel seguente ciclo?ARM Assembler - Come si usano CMP, BLT e BGT?
Sto provando a utilizzare BGT, BLT e CMP perché ne ho bisogno per far funzionare la mia applicazione. Il problema è che non ho idea di come usarli. Se volessi usare CMP per confrontare r6, con r4 e mettere la differenza in r7, come farei? La stessa domanda se volessi usare BLT se r7 è minore di 0, come farei?
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
Ecco il mio intero ciclo:
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
Le tue domande non sono chiare. Si prega di precisare. –
Ho aggiunto un'ulteriore descrizione alla mia domanda. – user1080390