Actually this has been fixed in the start12.c contained in the HCS12X V4.0 release (which does not target HC12/HCS12 directly, but the start12.c it contains works also for HC12 V3.1). Let me know (off list) if I should send you the new start12.c of HCS12X V4.0. (you could also download the complete HCS12X V4.0 from the Metrowerks web page, but that's a big > 100MB download just to get a 15 kB file.) Daniel .... LDD 2,X+ ; byte count #ifdef __OPTIMIZE_FOR_SIZE__ /* -os, default */ NextWord: CLR 1,Y+ ; clear memory byte __FEED_COP_IN_HLI() ; feed the COP if necessary /*lint !e505 !e522 asm code */ DBNE D, NextWord ; dec byte count #else LSRD ; /2 and save bit 0 in the carry * BEQ LoopClrW1 ; do we copy more than 1 byte? * PSHX LDX #0 LoopClrW: STX 2,Y+ ; Word-Clear __FEED_COP_IN_HLI() ; feed the COP if necessary /*lint !e505 !e522 asm code */ DBNE D, LoopClrW PULX *LoopClrW1: * BCC LastClr ; handle last byte CLR 1,Y+ LastClr: #endif PULY ; restore nofZeroOuts #ifdef __OPTIMIZE_FOR_SIZE__ /* -os, default */ Copy: MOVB 1,X+,1,Y+ ; move a byte from ROM to the data area __FEED_COP_IN_HLI() ; feed the COP if necessary /*lint !e505 !e522 asm code */ DBNE D,Copy ; copy-byte loop #else LSRD ; /2 and save bit 0 in the carry * BEQ Copy1 ; do we copy more than 1 byte? *Copy: MOVW 2,X+,2,Y+ ; move a word from ROM to the data area __FEED_COP_IN_HLI() ; feed the COP if necessary /*lint !e505 !e522 asm code */ DBNE D,Copy ; copy-word loop *Copy1: * BCC NextBlock ; handle last byte? MOVB 1,X+,1,Y+ ; copy the last byte #endif Mike wrote: >Yes that also works ... there is an optimize for size setting in the same code area ... depending on what you have selected drops in different copy down code. > >Problems like this would be a nightmare for newbees. > >Mike. >#ifdef __OPTIMIZE_FOR_SIZE__ /* -os, default */ >Copy: MOVB 1,X+,1,Y+ ; move a byte from ROM to the >data area > __FEED_COP_IN_HLI() ; feed the COP if necessary >/*lint !e505 !e522 asm code */ > DBNE D,Copy ; copy-byte loop >#else > >>>>>>>>>>>>This is where the problem is <<<<<<<<<<<<<<<<< >>>>>>>>>>>> >>>>>>>>>>>> > > LSRD ; /2 and save bit 0 in the carry >Copy: MOVW 2,X+,2,Y+ ; move a word from ROM to the >data area > > ----- Original Message ----- > From: tonalbuilder2002 > To: > Sent: Wednesday, March 02, 2005 2:23 PM > Subject: [68HC12] Re: Start12.c source code problem > > Just recently I ran into a similar problem in the same part of > start12.c code. The problem appeared when I started tinkering with > compiler optimization settings. In my case start12 was trying to > initialize 0xffff bytes of RAM, including...you guessed it...the > stack. Gave me a whole new apprecation for the simulator. > > In my case the fix was to back off on optimization. > > Bill T. > http://www.kupercontrols.com > > >Yahoo! Groups Links > > |