If I have a pointer to the start of a memory region, and I need to read the value packed in bits 30, 31, and 32 of that region, how can I read that value?
Memory locations are 8-bits, but pointers are 32 bits (or 64 or whatever), not 8.
@Progear: When the process is reading a byte, it will read the 32-bit word the byte is in. Those 32 bits go from the bus into a shift unit that is in line with the load unit. The desired 8 bits come out of the shift unit and go into the general processor register (or equivalent) that they are being loaded into.
A piece of computer memory can be represented by a series of 0's and 1's, with one digit for each bit of memory; the value 1 represents an “on” bit and a 0 represents an “off” bit. This notation is described as binary form.
Use bit masks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With