View previous topic :: View next topic |
Author |
Message |
Wirgle Guest
|
bit_clear, bit_test |
Posted: Tue Sep 22, 2009 5:16 am |
|
|
Where can i find the function definition of bit_set and bit_clear ?
O. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Sep 22, 2009 5:29 am |
|
|
There is no real 'function definition' for these functions, they map directly onto the machine assembly instructions 'BSF' and 'BCF'. |
|
|
Wirgle Guest
|
|
Posted: Tue Sep 22, 2009 5:39 am |
|
|
So, if i want to make my own... What should i do? |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Tue Sep 22, 2009 8:38 am |
|
|
This is like saying ..
I hand you a bucket of water.
And you say but I want to make my own water.
Its done for you. Why would you re-invent the wheel?
that being said..
from the help file for bit test.
Quote: | Tests the specified bit (0-7,0-15 or 0-31) in the given variable. The least significant bit is 0. This function is much more efficient than, but otherwise the same as: ((var & (1<<bit)) != 0)
|
you can use something similar for bit set
and bit clear
But the built in way is what you should use. |
|
|
|