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

over 16 bit DPTR limit

I have 8051 with 2 DPTR, SFR register to switch data banks(32Kb/16Kb)... Both DPTRs used to increment read/write pointers. I need correct 32bit address increment over all accessible memory.
How to widen DPTR to work with 32 bit address?

Parents
  • The Keil tools support extended DPTRs by using far memory. You'll have to customize XBANKING.A51 or L51_BANK.A51 to support your exact hardware.

    The 8051 variants I know with extended DPTRs have 24-bit DPTRs -- one additional byte per pointer. The Keil generic/far pointer scheme is also a 3-byte format, so it can't store 32-bit addresses.

    If you really need 32-bit-wide DPTRs, you're going to have to do most of the work yourself. Create a type that is 32 bits (a structure, as you suggest). Then you'll need to create some library routines to write the upper bits of that value to your extended hardware, and the lower bits to the DPTR proper. You'll probably want routines to set a memory bank and to extract a far pointer from the 32-bit value.

Reply
  • The Keil tools support extended DPTRs by using far memory. You'll have to customize XBANKING.A51 or L51_BANK.A51 to support your exact hardware.

    The 8051 variants I know with extended DPTRs have 24-bit DPTRs -- one additional byte per pointer. The Keil generic/far pointer scheme is also a 3-byte format, so it can't store 32-bit addresses.

    If you really need 32-bit-wide DPTRs, you're going to have to do most of the work yourself. Create a type that is 32 bits (a structure, as you suggest). Then you'll need to create some library routines to write the upper bits of that value to your extended hardware, and the lower bits to the DPTR proper. You'll probably want routines to set a memory bank and to extract a far pointer from the 32-bit value.

Children