memory - Why does some sfr in 8051 are bit addressable? -


According to this, sfrs whose addresses are divisible by 8 are bit knowable. You can work on them like SETB or CLR Are there. But are they not overlapping other memory addresses? I mean, for example, if P0 is in 80h then P0.0 will be 80h, P0.1 will be 81h. But the address of 81 HSP is. Do they overlap?

You are confusing a bit address with a byte address. They do not overlap or refuse the same physical location. Instructions that take the bit addresses (like SETB) know how to decode a bit address into a byte address and bit number, byte address is obtained by masking 3 minimum bits in the I bit address. The bit number is obtained by masking maximum 5 bits.

e.g. Bit address 87h -> byte address 80h, bit # 7


Comments