2008-04-03 11:50 AM
Code space question: 8-bit vs 32-bit
2011-05-17 03:28 AM
We are migrating to the 32-bit world from the 8-bit world (8051), where we fit our functionality comfortably into 64k of code space.
How much code space do I need for this 32-bit chip for the same code? Might I need 256k? ***Wild**** guess, I know. Anything would help. Maybe based on your own experience porting?2011-05-17 03:28 AM
No, you don't need 256k in a 32 bit processor for an application 64k in a 8 bit processor.
For Cortex-M3, Thumb2 code is very compact. Difference of code size from 8051 to Cortex-M3 depends of type of application. If you manipulate a lot of bits, 8051 is better because it has some compact instruction to manipulate bit. If you make sone 16 bits or 32 bits operations, Cortex-M3 is better because a 32 bit operations is only one instruction rather four instructions for a 8051. It depends also which compiler : Gnu is free but code is not very compact. Some commercial compiler make very compact code.2011-05-17 03:28 AM
about 5k of 8051 code generated by SDCC became around 10k of code when compiled by gcc optimizing for size, 12.5 k when optimizing for speed. There are many vintages of gcc floating around, I use the 2007Q3 release from codesourcery.