Hi I need to put some function in the first 8k area of my program. The function that i will put there is. START_MXB.asm Interrupt and my bootloader. This area should not be optmized and i don't want any library function in this area. My function main should start at 0x2000. And here I want to optimize. How should i set up my linker to solve this?
Take a look to the USERCLASS feature. Example: http://www.keil.com/support/docs/2670.htm Reinhard
OK I now have done this in my code.
pragma userclass (code = IAP) // Generates CODE_IAP class
CODE_IAP (C:0x2000 - C:0xFFFF)
800FC9H 800FD1H 000009H BYTE UNIT CODE ?L?COM023F
Specify in addition the CODE class and use a memory region that excludes 0x800000 - 0x801FFF. Reinhard
If I do this, then i also will move start_mx from this area.
NAME ?C_STARTUP ?C_C51STARTUP SEGMENT CODE
Then change the segment directive in the startup code to:
?C_C51STARTUP SEGMENT 'CODE_IAP'
Hi I try'd to do that, and get this Error. *** ERROR L115: PARTIAL SEGMENT BELONGS TO DIFFERENT MEMORY CLASS SEGMENT: ?C_C51STARTUP MODULE: E:\KEIL\C51\LIB\CX51L.LIB (?C_INIT) And if i want to read more about "ERROR L115" I get this answer. *** Error L115 INPAGE SEGMENT IS GREATER THAN 256 BYTES SEGMENT: segment-name I'm a little bit confused! Ingvar
Hi I solved my problem by writing 2 program. One starting at 0x800000 and the second starting at 0x802000. Is there some way to link the two programs to one program? Ingvar
Is there some way to link the two programs to one program? Probably no. The best you can likely achieve is to merge the two HEX files. Just concatenating them may be enough, but in case of doubt you'ld better use real tools.
Yes, there is a way. See: http://www.keil.com/support/docs/2385.htm Reinhard