Dark Byte Site Admin Reputation: 458 Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Fri Feb 23, 2018 2:28 am Post subject: |
|
|
Code: |
function setbit(address, bitnr, state)
if (bitnr>7) then error('setbit only works for byte sizes. rewrite this for bigger values') end
b=readBytes(address,1)
if (state==1) then
b=b | (1<<bitnr)
else
b=b & ~(1<<bitnr)
end
writeBytes(address,b)
end
|
bitnumber counts from 0 _________________ Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping
|
|