C/Direct memory access
From Attie's Wiki
(Difference between revisions)
m (Created page with 'This example shows how to access memory locations directly (in this case a 16-bit register) <source lang="c"> unsigned short *p; unsigned short mask = 0x400; p = 0xFFFE3A02; if …') |
Revision as of 15:37, 31 August 2011
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; }