What does BAL do?Code:loop: CMP R1,#0 SUB R1,R1,#1 LDR R4,[R2] ADD R3,R3,R4 ADD R2,R2,#4 BAL loop DoneLoop: swi 0x11
What does BAL do?Code:loop: CMP R1,#0 SUB R1,R1,#1 LDR R4,[R2] ADD R3,R3,R4 ADD R2,R2,#4 BAL loop DoneLoop: swi 0x11
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Damn that took a lot of googling. In ARM BAL means branch always.