browse: forums | FAQ
Connecting Tech Pros Worldwide

Hey there! Do you need C / C++ help?

Get answers from our community of C / C++ experts on BYTES! It's free.

8051 Code migration

Newbie
 
Join Date: May 2009
Posts: 3
#1: May 17 '09
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?



Newbie
 
Join Date: May 2009
Posts: 3
#2: May 18 '09

re: 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?
Needs Regular Fix
 
Join Date: Jul 2008
Posts: 454
#3: May 18 '09

re: 8051 Code migration


Does
Expand|Select|Wrap|Line Numbers
  1. #define xdata
  2.  
(empty define)
work?
Newbie
 
Join Date: May 2009
Posts: 3
#4: May 18 '09

re: 8051 Code migration


Thank you Newbe16.

You've opened my eyes :)
Reply

Tags
code, migration, redefinition, typedef