XRAM 读写

//外部xram写
void xram_write(unsigned int addr, char byte)
{
   char xdata * data pwrite;           // write pointer


   pwrite = (char xdata *) addr;       // initialize write pointer
   


   *pwrite = byte;                     // write the byte


}


//外部xram读
char xram_read(unsigned int addr)
{
   char xdata * data pread;           // read pointer


   pread = (char xdata *) addr;       // initialize read pointer
   


   return *pread;                     // read the byte

}


XBYTE[0x100] = 100;//写

uchar temp =  XBYTE[0x100];//读



你可能感兴趣的:(XRAM 读写)