0

I am trying to understand how to do a while loop with multiple conditions in ARM assembly.

For example trying to code this:

                  while ((i>0)&&(val < (ls->sortedList[i-1]))) 

I understand how the logic of a while loop works in ARM assembly and I get how I would code both of those compares separately. I am just confused on how you would make it so the while loop doesn't continue unless both of those conditions are true in ARM assembly.

Thank you!

  • 2
    Try compiling the file which contain this command with `gcc -S` (if you use gcc) – Garf365 Nov 03 '16 at 16:04
  • 1
    Check this link possibly has the answer: http://stackoverflow.com/questions/19781523/double-conditions-in-arm-assembly – Omid CompSCI Nov 03 '16 at 16:04
  • 1
    Consider that `while (i>0) {...}` could be expressed as `while(1) { if (i>0) break; ... }`, and that you already know how to implement that, then consider how short-circuit logic operators are evaluated. – Notlikethat Nov 03 '16 at 16:14

0 Answers0