Data type 與 Variables

 

 

  • sbit
  • sfr
  • bit
  • [unsigned] char
  • [unsigned] int
  • data
  • idata
  • pdata
  • xdata
  • code

Example1:

unsigned char data output;

Example 2:

sfr PSW = 0xD0;

sbit CY = PSW^7;

bit YesOrNo;        // 佔用bdata區的一個位

 


 

Global

  • global variables (file scope)

 


 

Static

  • Static local variables (present when the function is called again)

Example:

static int x = 0;

 


 

external