Thanks a lot Maarten, I've made sense of the extended address record. However one thing still confuses me. If I build a small app that all fits in the common area, the output.ihx still contains two extended address records, along the lines of:-
:020000040000FA // I guess this means bank0? .. <some data records> .. :020000040001F9 // I guess this means bank1? .. <more data records> .. :0400000500000000F7 :00000001FF I guess the linker must think the banked area starts at a lower address. How do I set the banked area? (or have I misunderstood completely?!) Thanks in advance, Andy > > Message: 4 > Date: Fri, 23 Jan 2009 20:28:49 +0100 > From: "Maarten Brock" <sourceforge.br...@dse.nl> > Subject: Re: [Sdcc-user] Help with code-banking > To: sdcc-user@lists.sourceforge.net > Message-ID: <497a2881.5191.28cf6...@sourceforge.brock.dse.nl> > Content-Type: text/plain; charset=US-ASCII > > Andy, > > SDCC generates a so-called extended intel-hex file. This > also contains records to indicate the start of a new > segment/bank. If your bootloader or whatever you use to > program the chip(s) does not understand extended hex- > files you can use srecord to split the file into several > hex-files for the banks. > > HTH, > Maarten > > > I'm evaluating SDCC for a project, which needs code-banking > (we estimate > > code size >64k). Are there any examples of how to do code-banking? I > > have seen and followed the instructions (see below), but I > think there > > is one thing I still need to know. > > > > On our hardware, the common area is 0x4000-0x7fff, with banks from > > 0x8000-0xFFFF. > > > > The keil compiler outputs a separate .ihx file for each > bank. However I > > can't find how to do that with SDCC. I can build an image using the > > script below, and the .map file shows everything at the right place > > (BANK1 and BANK2 look correctly overlaid). However I don't see how a > > single .ihx file can work. Is there a way to produce many > .ihx files, or > > some way to produce an output that describes >64k code? > > > > Can someone help me in the right direction? > > Thanks, > > Andy > > > > > > > > COMPILE:- > > sdcc -c main.c > > sdcc -c bank1stuff.c (this contains pragma codeseg BANK1) > > sdcc -c bank2stuff.c (this contains pragma codeseg BANK2) > > asx8051 mytrampoline.asm > > > > LINK:- > > sdcc --code-loc 0x4000 -Wl-bBANK1=0x18000 -Wl-bBANK2=0x28000 -Wl-r > > $(OBJS) > > > > ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user