gEDA-user: C question

Andy Peters devel at latke.net
Sun Mar 4 15:58:45 EST 2007


On Mar 3, 2007, at 4:57 PM, carzrgr8 at optonline.net wrote:

> Thanks.  I threw the question to the group because I know there's  
> plenty of knowledgable people reading willing to answer it.
>
> Anyway, I was trying to get the compiler to generate 2 versions of  
> an initialized array: ROM, and RAM.  The processor I am using has  
> more ROM than RAM, so
> placing the code into ROM makes more sense, yet I was having  
> trouble getting access it correctly due to a routine expecting a  
> const ptr.  So, I was trying it in
> RAM, but not sure if the code was correct.
>
> Thanks again for the help :)

You didn't say which compiler you're using, nor which architecture.

But Keil's 8051 compiler has the "code" keyword, which tells the  
compiler that the variable should be put into CODE space, which is by  
definition ROM.

-a


More information about the geda-user mailing list