位操作点滴

#define GPBCON      (*(volatile unsigned long *)0x56000010)
#define GPBDAT      (*(volatile unsigned long *)0x56000014)

int a;     |
int *p;   |
p=&a;    |  p=(int *)0x56000050
              | *p=0;====a=0;  | *p=0x100;
              | *((int *)0x56000050)=0x100
              |  volatile 让编译器不要去优化

              |  (*(volatile unsigned long *)0x56000014)

 

-------------------------------------------------------------------------------------------
位操作

//掩码bit9:8位设为0
#define GPF0_msk (3<<(0*2))

GPFCON &= ~GPF)_msk;


  0000..0001100000000
  1111..1110011111111

 

-------------------------------------------------------------------------------------------

你可能感兴趣的:(位操作点滴)