Topic : How to put startup.a51, c-code and assembler code on fixed address?

Forum : 8051

Original Post
Post Information Post
October 20, 2009 - 4:11pm
Guest

Hi,

I'm writing a bootloader application. I have some C-code functions and one single assembler function acting as an interface between C-code and the Atmel bootloader API functions.

I put all C-functions into one file and used the advised linker directive
#CODE (?PR?MAIN?MYFILE(0xA000))
but code is still loaded from address 0x0000.

If I set the linker to use startaddress 0xA000 then code is placed on address 0xA000.
So probably the linker is overruling the sourcecode directive.

But my single assembler function conflicts with the startup file both being located at address 0x0000.

I would like to have all three items:
- startup.a51
- my C-functions
- the single assembler function
being loaded on my bootload address 0xA000.

What do I need to do?

Thanks,

Henk

Replies
Post Information Post
+1
0
-1
October 21, 2009 - 11:51am
Guest

Hi

If I understand your issue you need to place three segments in 0xA000.
Lest say the names of your asement are:
- ?PR?C51_STARTUP?
- SEGC
- SEGASM

In this case you can try the following syntax:
CODE(?PR?C51_STARTUP?(0xA000),SEGC,SEGASM)

Regards,
Matloub