8051 Code migration

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alonx
    New Member
    • May 2009
    • 3

    8051 Code migration

    Hello all,

    I need to migrate a 8051 C based code into ARM platform.
    In the new platform I'm using a newer C/C++ compiler that does not recognise the old platform compiler keywords like: xdata, bit, etc...

    In order to migrate these old keywords to the new compiler I wrote:
    typedef int bit;

    That did the job for the bit keywords (hundreds of compiler error were gone at once... ).
    But now I have the problem with the xdata identifier. In this case I just want the precompiler to ignore it as if it is not there.
    A sample line appears below:
    extern xdata char Upd_CommandBuf[];
    I need it to become:
    extern char Upd_CommandBuf[];
    I've tried to write:
    typedef char xdata char;
    But the precompiler does not understand this.

    Does someone has a clue?
    Last edited by debasisdas; May 18 '09, 08:04 AM. Reason: Thread moved to C/C++ forum.
  • Alonx
    New Member
    • May 2009
    • 3

    #2
    8051 Code migration

    Hello all,

    I've already posted this question but maybe in the wrong location, so I'll try again here...

    I need to migrate a 8051 C based code into ARM platform.
    In the new platform I'm using a newer C/C++ compiler that does not recognise the old platform compiler keywords like: xdata, bit, etc...

    In order to migrate these old keywords to the new compiler I wrote:
    typedef int bit;

    That did the job for the bit keywords (hundreds of compiler error were gone at once... ).
    But now I have the problem with the xdata identifier. In this case I just want the precompiler to ignore it as if it is not there.
    A sample line appears below:
    extern xdata char Upd_CommandBuf[];
    I need it to become:
    extern char Upd_CommandBuf[];
    I've tried to write:
    typedef char xdata char;
    But the precompiler does not understand this.

    Does someone has a clue?

    Comment

    • newb16
      Contributor
      • Jul 2008
      • 687

      #3
      Does
      Code:
      #define xdata
      (empty define)
      work?

      Comment

      • Alonx
        New Member
        • May 2009
        • 3

        #4
        Thank you Newbe16.

        You've opened my eyes :)

        Comment

        Working...