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

C51 Regarding generic pointers and the use of 2 DPTRs

I am writing code that requires a fair amount of pointer arithmetic and manipulation. The C51 compiler appears to generate lots of generic pointers (much too my dismay). Is there any way to use the built in dual DPTR's to reduce the massive overhead associated with generic pointers significantly? The C51 derivative I'm using (MCS12XX) does have dual data pointers as far as I can tell.

I've attempted judicious use of the

#pragma modp2


directive with no visible change in the code output from the compiler.
Specifically I am generating graphic information that is sent to a memory mapped graphic LCD. It works just fine that's not the problem. The problem is code space and the overhead that the generic pointers have are going to make things difficult to complete as wished. So is there a way to get around this?

Stephen

Parents Reply Children
  • First thanks for explaining what was going on with the generic pointers. I guess I didn't tweak on the compiler enough to find out the internal pointer abuse going on. I plan to abuse xdata pointers more.

    Indeed Erik that is what I discovered (amongst other surprises). So if I use an explicit pointer in this case it will reduce overhead. The generic pointers have been a killer (sigh) so I plan on doing something like

    #define LPTR xdata
    

    and putting that in front of anything that's suffering from generic data pointers horribly. That way if the code goes to a different processor I just redefine that to an empty define and it becomes normal.

    Stephen