here's a little question on parallel port. Many programmers when they want to make bit 2 of control '1' i.e pin 16 write:
outporb(CONTROL, 0X04^0X0b); for example. Why don't they simply write: outportb(CONTROL, 0X0f)? aren't they the same thing?
Let me just explain: 0X04 ^(EXOR) 0x0b is the same thing as (0100 EXOR 1011) which would give us 1111. Now the hardware inverts this to 0100.
If we simply put outportb(CONTROL, 0X0f) it'll mean we're inputting 1111 to CONTROL port and by hardware inversion we have: 0100. Why the obsession with making life difficult? :?