|
-
Dec 31st, 2003, 03:43 PM
#1
Thread Starter
Frenzied Member
opcode's
Hi,
I was told that there is an intel opcode that can be used to get the first bit set of an integer. I've searched all over and can't find anything, let alone some good documentation on this stuff.
Does anyone know what it is, and how I would go about using this?
If not, is there any other fast way to get the first set bit of an int without looping through each bit?
Thanks!
-
Dec 31st, 2003, 06:45 PM
#2
transcendental analytic
bsf is the forward bitscan operator and bsr reverse
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 31st, 2003, 07:42 PM
#3
Thread Starter
Frenzied Member
How would I use that, could you please provide an example? Thanks!
-
Jan 1st, 2004, 06:27 AM
#4
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|