Hi chulsung and all :)
Humm, from your last message I have some questions to have global view of problem...
On Keil (or other compiler and linker software) there is certainly a Makefile (eg makefile.mak under Tasking chain)
Could you send your Makefile under Keil and under SDCC (I recently migrate a project from Tasking to SDCC and the Makefiles comparison is a good work for looking all compiler and linker options ...)
About an another mail from this ML : I'm interresting how do you compare your size code too ! (size of the .hex file (not the good method) or map-memory after linking (good method to view the whole code space)
If your code space passed from 10KB to 3KB with SDCC (and stay at 5KB with Keil) what is your problem today ?
Personally my compil options are the follows :
# -Wa : Warning All
# -c : compil only (last option)
# -mmcs51 : cible type x51 << I work under x51 heart microprocessor
# $(MODEL_PROJECT) --model-large : model large << my model
# -I$(INCLUDE_DIR) : directory headers ...
And my linker options are :
# Code Addr and size
CODE_ADDR = --code-loc 0x0000
CODE_SIZE = --code-size 0x7FFC
# RAM Addr and size
DIRECT_RAM_ADDR = --data-loc 0x00
INDIRECT_RAM_ADR = --idata-loc 0x80
RAM_SIZE = --iram-size 0xFF
# External RAM Addr and size (on chip with EXTRAM = 0) (start at 0x0001 to avoid NULL pointer tests on libs)
XRAM_ADDR = --xram-loc 0x0001
XRAM_SIZE = --xram-size 0x7FF
# Stack Addr and size
#STACK_ADDR=  // Not specified
STACK_SIZE = --stack-size 80
# ouput format => Intel HEX
OUTPUT_FORMAT = --out-fmt-ihx
I thinks It's a generaly Makefile's options template (options can be change for adapting to target user)
I hope my message will give you some information...
> Hi Folks,
> I feel obliged to report something to appreciate your help and answer
> Vincent's questions.
> 1. What I am doing...
> I am using a nRF24E1 (from
www.nvlsi.com) microcontroller + 2.4GHz radio.
> We developed very tiny wireless sensor node using this chip.
> For more details about our hardware, please refer to my homepage
> I used the Keil compiler but I wanted to make use of SDCC for this project.
> 2. Keil compiler.
> the code size of the hex file was 5KB. For compiler and linker options,
> at first I used "Default". I made a change to (smallest code size) and
> (speed)
> the code size wasn't really changed.
> 3. SDCC
> without the compile option (--model-small --opt-code-size), the code size
> was larger
> than 10KB. But with these option it reduced to 3KB, which is smaller than
> what i get
> from Keil. One thing is that once I used above compiler options, even though
> I don't
> type the options again, SDCC still generate the hex code, which size is 3K.
> Do you guys think I made some mistakes? To see what happened, I will
> uninstall SDCC
> and reinstall it. Any ideas about my observation?
> That's all. Thank you again for your help.
> Thanks,
> -cs
> -----Original Message-----
> From:
> [mailto:sdcc-user-admin@lists.sourceforge.net] On Behalf Of BRACH vincent
> Sent: Friday, October 07, 2005 12:33 AM
> To:
> Subject: Re: [Sdcc-user] Code Size
> Hello all,
> chulsung, what's your compiler and linker options ? (for Keil and SDCC ;))
> Did you use some optimisations options ?
> vinzzz
> > Hello,
> >
> > I compiled the same source code using both SDCC and Keil.
> > But the code size (hex file) of SDCC is twice or three times bigger
> > than that of Keil.
> >
> > Does anybody have a idea about how to reduce the code size?
> > Thank you in advance.
> >
> > chulsung
> >