We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I has defined some xbyte macro,as belows:
#define PA XBYTE[0XF100] #define PB XBYTE[0XF200].....
now,i want pass the PA and PB as a parameter of a function, how to declare them in the function?
if i wrote the function like this :
f(XBYTE * b) { unsigned char temp; *b = temp; }
call like this:
f(PA);
the keil's compile will be error. -------------------------------------------- And if i wrote the function like belows :
f(unsigned char b) { uchar temp; b = temp; }
call also like this:
keil's compile will passed,but the mcu will not access the extran data RAM, and the RD/WR signal will not pull low.
HOW CAN I declare a xbyte address in the function's parameter? THANK YOU.
www.keil.com/.../c51_le_memspecificptrs.htm
Better, stop messing about with XBYTE and define proper variables in XDATA space: http://www.keil.com/support/man/docs/c51/c51_le_extdatamem.htm
Use _at_ if you really need to manually assign absolute addresses: http://www.keil.com/support/man/docs/c51/c51_le_absvarloc.htm
Keil C51 offers a number of extensions to the standard ANSI 'C' language to specifially address the particular features of the 8051 architecture.
Now would probably be a good time to take a look at them: http://www.keil.com/support/man/docs/c51/c51_extensions.htm