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 have problem about location of local variable in data memory. In my code void WRITE_RTC(uchar Dat,uchar Addr) { xxx=(RTC_ADDR|WRITE); Start(); Out_Byte(xxx); Out_Byte(Addr); Out_Byte(Dat); Stop(); } but in M51 file it show TYPE BASE LENGTH RELOCATION SEGMENT NAME DATA 0074H 0002H UNIT ?DT?_WRITE_RTC?I2C_DEVICE_FUNCTION3 in function I have only local variable uchar Dat,uchar Addr why keil fix address for them
Note that the beginning of the 2nd paragraph in that link directly answers your original question: "Normally, functions in Cx51 cannot be called recursively or in a fashion which causes reentrancy. The reason for this limitation is that function arguments and local variables are stored in fixed memory locations." Unless you absolutely need your functions to be reentrant, do not specify the 'reentrant' attribute. As it says in the link, that will make your code grossly inefficient!