CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2007
    Posts
    1

    Help ..............to find a code................

    hello,
    Thx in advance...i need to write an assembly code to find a the first zero bit in a bit string....

    1. it takes an unsigned long variable
    2. i need to extract the long variable in terms of 32 bits.
    3. search for the first zero bit..\
    4. if the zero is not found in the first set of 32 bits , i need to shift to the next 32 bits and to perform the same search operation.
    5. repeat the step 3 till i find a zero bit

    pls help me..it is very urgent.,...
    bye
    sweety

  2. #2
    Join Date
    Nov 2004
    Posts
    34

    Re: Help ..............to find a code................

    You'll have to do the work yourself.

    Here is some logic to help you out:

    -x & (x+1)
    = rightmost zero bit
    = 0 if no zero bits in set

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured