Mail Archives: djgpp/1999/07/18/07:51:38
Bas Hamstra (bas DOT hamstra AT wxs DOT nl) wrote:
: Hello again!
:
: I am still very happy with the profiler patch, it really helped. Now I
: have a very small problem.
:
: In my chess program I need to find the last bit in a unsigned long long
: (or sometimes a unsigned long).
:
: Note: I just need the *index* of that bit. Now I know there is an
: assembler instruction for a 32 bit LastOne(). I used inline assembly in
: Borland 3.1 for that instruction and it worked.
:
: Two questions:
:
: a) How do I use inline assembler in DJ? It's different from BC...
: b) When LastOne works for a 32 bit number, how to for a ull ?
:
: It's time critical. Actually a PopCount() (count no bits) would be handy
: too but I think there's no assembly equivalent.
a) Look at <http://www.delorie.com/djgpp/> and read relevant
links. "info gcc" is useful too.
b) Not sure (am not an assembly guy). But how about checking the
correct first half first and not finding anything, check the
second half (all in assebler)?
Right,
MartinS
- Raw text -