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.
Hi,
How to use 24 bit addressing in keil for DP 8051.
We want it in C language.
If you intend to access 8 bits of unsigned data, you should write "unsigned char". If you just write "unsigned", it will return an unsigned integer which is 16 bits.
For size of data types, see: http://www.keil.com/support/man/docs/c51/c51_ap_datastorage.htm
And once more, do be careful about naming conventions. Your original definition of REG8 returned unisgned long, which for the C51 compiler is 32 bits.
If you have hardware memory-mapped into the far data space, then yes, a declaration similar to this will work. (The comments already made about data types are well put.)
Your hardware external to the 8051 will of course have to decode the 24-bit address bus and select whatever device it is that has these registers. The details will be in the data sheet for your particular 8051 variant.