On Thu, Feb 11, 2010 at 12:27:04PM +0100, Brandon Fosdick wrote:
> Well, it looks like I spoke too soon. 
> 
> SDCC is still dumping some non-vector stuff in the GSINIT and HOME segments. 
> I see how I could use the linker to relocate GSINIT* segments to someplace 
> else (or modify the mcs51 library). But I don't see how to relocate 
> __sdcc_program_startup from HOME to CSEG. It doesn't seem to be defined 
> anywhere in the lib directory that was installed with SDCC.

        It is defined in main (and thus will be in the code generator somewhere
I expect), and called from sdcc/device/lib/mcs51/crtstart.asm. I expect you
would meed to modify the code generator to do what you want (or modify 
main.asm by hand).

vi main.asm 

...
; global & static initialisations
;--------------------------------------------------------
        .area HOME    (CODE)
        .area GSINIT  (CODE)
        .area GSFINAL (CODE)
        .area GSINIT  (CODE)
        .globl __sdcc_gsinit_startup
        .globl __sdcc_program_startup
        .globl __start__stack
        .globl __mcs51_genXINIT
        .globl __mcs51_genXRAMCLEAR
        .globl __mcs51_genRAMCLEAR
        .area GSFINAL (CODE)
        ljmp    __sdcc_program_startup
;--------------------------------------------------------
; Home
;--------------------------------------------------------
        .area HOME    (CODE)
        .area HOME    (CODE)
__sdcc_program_startup:
        lcall   _main
;       return from main will lock up
        sjmp .
;--------------------------------------------------------
...

Peter Van Epp

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to