View Single Post
Old 06 November 2021, 12:40   #24
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Quote:
Originally Posted by meynaf View Post
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)?

Last edited by a/b; 06 November 2021 at 13:02.
a/b is offline  
 
Page generated in 0.04292 seconds with 11 queries