Re: Microchip Introduces First 16-bit Microcontroller Product Line - the PIC24



Mark L Pappin wrote:
"Michael N. Moran" <mike@xxxxxxxxxxx> writes:
OK. Please explain to me how one *without going outside of
the C/C++ language standard* declare an "unsigned char" for
the AVR that lives in the AVR ROM space and another that
lives in the AVR RAM space?


  unsigned char lives_in_RAM = 'a';
  const unsigned char lives_in_ROM = 'b';


This really is one of the major problems of C. The construct above doesn't work with, for example, the Raisonance 8051 compiler, where even if you declare a const, it still assumes it's in the internal RAM unless you precede it with "code".


This kind of thing makes porting code a bugger, even a debugger, and it's time the industry got together to work out a standard. While you're at it, define a portable way of allocating objects to specified locations.

Paul Burke
.


Quantcast