This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

24 bit addressing required in keil for DP 8051

Hi,

How to use 24 bit addressing in keil for DP 8051.

We want it in C language.

Parents
  • See the sections of manual that discuss bank switching.

    To summarize, you need to include an extra file in your project, either XBANKING.A51 (for data banking only) or L51_BANK.A51 (which can do both code and data banking).

    You must customize the code in these files to write the extra byte of DPTR. (Many 8051 variants, for example, have an extra SFR often called DPX that holds the upper 8 bits of a 24-bit DPTR address.) The example code has support for a few common address extension schemes, so you can activate that code with defining a few values.

    Once you have this code correct, you simply tell the compiler that you have banking enabled. The far keyword allows you to define 24-bit pointers and declare variables in "xdata" beyond the first 64KB.

Reply
  • See the sections of manual that discuss bank switching.

    To summarize, you need to include an extra file in your project, either XBANKING.A51 (for data banking only) or L51_BANK.A51 (which can do both code and data banking).

    You must customize the code in these files to write the extra byte of DPTR. (Many 8051 variants, for example, have an extra SFR often called DPX that holds the upper 8 bits of a 24-bit DPTR address.) The example code has support for a few common address extension schemes, so you can activate that code with defining a few values.

    Once you have this code correct, you simply tell the compiler that you have banking enabled. The far keyword allows you to define 24-bit pointers and declare variables in "xdata" beyond the first 64KB.

Children