Code size compared to 8051

I have run out of the 64K code space on my 8051 processor and need to port to something like the Cortex-M3 with 128K. BUT...with a 32 bit processor, in theory I'd need 256K of program memory just to break even. Does anyone have experience with what the real multiplier is between an 8 bit device and one of these? Can I reasonably expect that I'll have more room for code moving this way?

Parents
  • "in theory I'd need 256K of program memory just to break even"

    How on earth did you come to that conclusion?!

    I presume you're working on the basis that an 8051 is 8-bit, an ARM is 32-bit, which is 4*8, therefore the code will 4*64K = 256K - yes?

    It really doesn't work like that!

    That assumes that every 8051 instruction has exactly one equivalent ARM instruction that is exactly four times the size - which is clearly nonsense!

    A lot of your 8051 code will be concerned with doing things that simply aren't necessary on an ARM - like loading & reloading DPTR, having to "manually" implement multi-byte operations with single-byte instructions, etc, etc...

    And don't forget Thumb mode...

Reply
  • "in theory I'd need 256K of program memory just to break even"

    How on earth did you come to that conclusion?!

    I presume you're working on the basis that an 8051 is 8-bit, an ARM is 32-bit, which is 4*8, therefore the code will 4*64K = 256K - yes?

    It really doesn't work like that!

    That assumes that every 8051 instruction has exactly one equivalent ARM instruction that is exactly four times the size - which is clearly nonsense!

    A lot of your 8051 code will be concerned with doing things that simply aren't necessary on an ARM - like loading & reloading DPTR, having to "manually" implement multi-byte operations with single-byte instructions, etc, etc...

    And don't forget Thumb mode...

Children
More questions in this forum