sbit EA = 0xAF;
This declaration defines EA to be the SFR bit at address 0xAF. On the 8051, this is the enable all bit in the interrupt enable register.
NOTE
Not all SFRs are bit-addressable. Only those SFRs whose address
is evenly divisible by 8 are bit-addressable. These SFRs
lower nibble will be either 0 or 8; for example, SFRs at 0xA8 and
0xD0 are bit-addressable, whereas SFRs at 0xC7 and 0xEB are not.
SFR bit addresses are easy to calculate. Add the bit position to
the SFR byte address to get the SFR bit address. So, to access
bit 6 in the SFR at 0xC8, the SFR bit address would be
0xCE (0xC8 + 6).
Any symbolic name can be used in an sbit declaration. The expression to the right of the equal sign (=) specifies an absolute bit address for the symbolic name. There are three variants for specifying the address.
Variant 1: sfr_name ^ int_constant
sfr PSW = 0xD0;
sfr IE = 0xA8;
sbit OV = PSW ^ 2;
sbit CY = PSW ^ 7;
sbit EA = IE ^ 7;
Variant 2: int_constant ^ int_constant
sbit OV = 0xD0 ^ 2;
sbit CY = 0xD0 ^ 7;
sbit EA = 0xA8 ^ 7;
Variant 3: int_constant
sbit OV = 0xD2;
sbit CY = 0xD7;
sbit EA = 0xAF;
NOTES
Special function bits represent an independent declaration class
that may not be interchanged with other bit declarations or bit
fields.
The sbit data type declaration may be used to access
individual bits of variables declared with the bdata memory
type specifier. See the section entitled Bit-Addressable
Objects in this chapter.