#bit #os #memory

nightly set_bits

Set and clear bits from specified address

7 releases (stable)

1.1.1 Apr 19, 2020
1.1.0 Apr 18, 2020
1.0.3 Apr 17, 2020
0.1.0 Apr 17, 2020

#313 in Operating systems

MIT/Apache

11KB
224 lines

set_bits

set_bits is a Rust library for setting and clearing bits on memory.

Usage

Add set_bits to your Cargo.toml file.

use set_bits;

// Set 20 bits from the 10th bit of address 0xCAFEBABE
set_bits::set(0xCAFEBABE, 10, 20);

// Clear 20 bits from the 10th bit of address 0xCAFEBABE
set_bits::clear(0xCAFEBABE, 10, 20);

License

Apache-2.0 or MIT

No runtime deps