cancel
Showing results for 
Search instead for 
Did you mean: 

Absolute address of Function for main() cosmic

drebbe
Associate II
Posted on May 09, 2013 at 07:41

Is there a way to define the address of main() to be at a specific location?

The Raisonance compiler has a ''at 0x8080 void main(void)'' syntax, does the cosmic compiler have something similar?

I've tried doing void ''main(void) @ 0x8080'' but compiler complains it doesn't recognize it.
1 REPLY 1
drebbe
Associate II
Posted on May 09, 2013 at 08:10

of course after I posted this I found a solution.

#pragma section (main)

void main(void)

{

    /* .... Code here */

}

#pragma section()

Then under linker settings:

# Segment Main:

+seg .main -b 0x9AAA -m 0x557 -n .main

A little bit more static than I wanted but should hopefully work. If there is a better way to do this, I'm all ears.