cancel
Showing results for 
Search instead for 
Did you mean: 

Code space question: 8-bit vs 32-bit

spencer
Associate II
Posted on April 03, 2008 at 20:50

Code space question: 8-bit vs 32-bit

3 REPLIES 3
spencer
Associate II
Posted on May 17, 2011 at 12:28

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?

ericvanolden9
Associate II
Posted on May 17, 2011 at 12:28

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.

andy239955_stm1
Associate II
Posted on May 17, 2011 at 12:28

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.