I have a project which has a large ROM, of which only 8KBytes is visible to the CPU. The rest of the ROM is accessed by a custom memory scheme. I want to ensure that all the CODE in the ROM resides in the bottom 8KBytes so it can be seen by the CPU, with the rest if the ROM conatining data. The _at_ directive (etc) is too inflexable - I want the data to follow on immediately after the code. How can I do this? Thanks in advance, Gary
I want to ensure that all the CODE in the ROM resides in the bottom 8KBytes so it can be seen by the CPU, with the rest if the ROM conatining data. Actually, this can be done using the CODE directive. You can specify the order in which segments are lined. Furthermore, you can specify wildcards for the segment names. If you name the files that include your code segments with a prefix you can use a wildcard version of that when you link. For example, if I put all of my constant segments in files named CONST_*.C the resulting segment names would be ?CO?CONST_*. To link these at the end of your program memory, you could specify something like...
bl51 ... code(0x0000-0x1FFFF, ?C_*, ?PR?*, ?CO?CONST_* (0x1000))
Jon, you are a STAR :-)
Jon, you are a STAR :-) Glad I could help. Jon