This example shows how to access memory locations directly (in this case a 16-bit register)
unsigned short *p; unsigned short mask = 0x400; p = 0xFFFE3A02; if (*p & mask) { *p &= ~mask; } else { *p |= mask; }