placing array in specified place

General discussion on mikroC.
Post Reply
Author
Message
LittleGreenBear
Posts: 3
Joined: 19 May 2005 21:29

placing array in specified place

#1 Post by LittleGreenBear » 30 May 2005 15:15

Hey there!

How to place an array of initialized data into a specified space?
for routines I can use 'org' and for variables 'absolute' but when I use those words with an array it does not seem to make any difference?

example:

const unsigned char FontNR[10] org 0x800 =
{
0x00, 0x60, 0x60, 0x00, 0x00 , // .
0x20, 0x10, 0x08, 0x04, 0x02 , // /
}


Does not do the trick :(


Also, when I try to put more then 2 or 3 routines in a specified place
it does not seem to be willing to do so. I am sure that there is enough room between. Is there a special algo that the compiler uses to place routines that are calling each other on the same address but different page?

I want to make a bootloading option into my program, so I will need to know exact addresses of some routines and tables...

(Or does this mean that I have to go back to ASM again?)

Thanks for any help

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#2 Post by LGR » 30 May 2005 16:54

This is a deficiency in all 3 compilers (4 including dsPIC). I have requested in the Pascal wishlist that ORG also apply to Const arrays. Maybe you should request it in the C wishlist. I completely agree that there are times when you want to define where a constant array goes, or simply set aside a block of flash ROM for use with the flash write and read library.
If you know what you're doing, you're not learning anything.

Post Reply

Return to “mikroC General”