rifter1818
Well-known member
Is there any way to Access Memory one bit at a time? Have say 9699690 bits of memory 1s and 0s and read and write to each memory bit?
1. Point to your memory and cast as a Int64[]rifter1818 said:Is there any way to Access Memory one bit at a time? Have say 9699690 bits of memory 1s and 0s and read and write to each memory bit?
Joe Mamma said:1. Point to your memory and cast as a Int64[]
2. Grab each Int64 containing the bit you want to change.
3. Perform Bitwise arithmetic on the Int64 to modify the nth bit
to set bit n : myInt64 |= Math.Pow(2,n-1);
to clear bit n : myInt64 = ~(( ~myInt64 ) ^ ( Math.Pow(2,n-1) ));
There might be a more efficient method for the bit clear, but that should work.
Boolean algebra was always confusing to me.
joe mamma
rifter1818 said:Is there any way to Access Memory one bit at a time? Have say 9699690 bits of memory 1s and 0s and read and write to each memory bit?
I just want to clarify that you need to work with the values in the array, as I am afraid, you might not get what you are looking for.rifter1818 said:Is there any way to Access Memory one bit at a time? Have say 9699690 bits of memory 1s and 0s and read and write to each memory bit?