Quote:
Originally Posted by meynaf
You will break out of the loop after 29 iterations, then have to execute it 3 more times as i loop over all '1'. So yes you'll do 32 iterations in total, dbcs or not.
Now your dbcs does not update the counter when it exits, requiring an extra instruction to fix this before looping back.
|
Ah, OK. You were considering the whole thing, including your "outer" loop over all the 1s. I was talking only about a single instance of finding the lowest 1. My bad.
EDIT: Bigger picture... You most likely went through this but we don't know what else is behind. Why exactly do you have to go from lowest to highest 1? Would it be possible to reverse the algorithm or maybe bit order in input data, and simply use bfffo+bclr+tst (or alternative exit instead of tst if your unspecified code happen to allow it)?