piclist 2001\02\26\170350a >
Thread: MPLAB-C porting
face BY : Mike Mansheim email (remove spam text)

>Yeah, but not with the MPLAB-C17 (demo) compiler.  I add the mask
>long*) to the right side of the equality statment and then make sure to
>enable the far pointers in the project and everything goes good.

Hate to belabor the point (too late, I suppose), but I don't think

         fraddr = (unsigned long*)flashadd;

is what you are after, whether flashadd is a long or not.  This assigns the
value at flashadd to frdaddr.  e.g. if flashadd is a long, and = 0x8000,
frdaddr will be equal to whatever value is in location 0x8000.

...just to thoroughly confuse things, I found an MPLAB-C17 user's guide.
According to that:  ints are 16 bit, and longs are 32 bit and are not
supported (maybe later? this is v2.10).  char is the 8 bit data type.
"far" declares paged/banked data.  It does have a few pages on porting code
from MPLAB-C to C17 that might be useful for you.  One of of things
was changing longs to ints.  Also talks about pointer lengths.
So this might be the correct setup:

            unsigned int flashadd = 0x8000;
            unsigned int far *frdaddr;            // "far" necessary?

            frdaddr = flashadd;

But these compilers are so different that I don't know...

http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


See also: www.piclist.com/techref/microchip/ios.htm?key=port
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) MPLAB-C porting

month overview.

new search...