If I say,
if a == 10 b = b * 4 + 2
if it does then do 'b = b * 4 + 2' or skip doing it? Would it be BNE or BEQ?
Something tells me it's DON'T DO...
Thanks
Something tells me you should learn how to use a debugger.
And maybe look at the assembler output of a C compiler.
Consider the difference between jumping to code or jumping around code - that represents a negation of the conditional test.
Something tells me you suck at helping and possibly are a troll.
I'm aware that conditional branch looks at flags.
Stop being so negative!
Either BEQ or BNE could be used. It simply depends on how your code flows.
Why don't you try breaking your code up a little more and see what might be the best solution?
You must surely be able to see that it could flow something like:
CMP A,#10 BNE Skip Do the maths Skip: Continue
But if your code was part of a subroutine it might be:
CMP A,#10 BEQ Continue return Continue: Do the maths return
I'll assume you can interpret my pseudo code/instructions.
View all questions in Keil forum