AnsweredAssumed Answered

Assigning fixed absolute address for a function?

Question asked by David Kelly on May 20, 2008
Latest reply on May 22, 2008 by CompilerGuru
Plenty of examples floating around for placing a variable at a specific memory address but finding examples of controlling the address of a function to be lacking. At least in the 8/16 side of the house.

Have inherited a bootloader in an S12NE64 that calls a function at 0x40a2. Would like to discuss options on how to place my function at that address.

So far have created a SEGMENT and used #pragma to place my function in that CODE_SEG.

COMPAT_40a2 = READ_ONLY 0x0040a2 TO 0x007fff FILL 0xff;

The above under SEGMENTS, the following under PLACEMENT doesn't seem right, but works:


This works, but it doesn't have the feel of control that I desire. The only reason my function is at 0x40a2 is that its the only one in that SEGMENT. OK, I can manually adjust the size of the segment and keep that routine as the only one placed there, but I'd like some cleaner means of control. Is there?