Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I locate const variables at specific address?

address const locate variables
0
Posted

How can I locate const variables at specific address?

0

For example: I would like to place: const int Tab[1,2,3]; const long lo=123435; starting at address 0x1200, and be sure that there is free space up to 0x13ff (whole memory segment); If your source file is called “myfile.c”, then you can place all const data starting at location 0x1200 using the linker command line option “ldseg=myfile_data_const=0x1200”. There is no way to reserve the balance of the space between the end of the const data and 0x13ff, however, except perhaps by declaring a const array of a suitable size follow your declarations or by just writing the whole thing in assembler. To locate a program segment at a particular address: For example the code corresponding to: void loader(void) { ….. } should be located from 0xFC00 to 0xFFDF If the source code is “myfile.c”, then you can put all code from that file starting at location 0xfc00 by using the command line option “ldseg=myfile_code=0xfc00”.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123