Content originally posted in LPCWare by CodeRedSupport on Tue Oct 19 01:55:09 MST 2010
It is true that the Cortex-M3 is a superset of the Cortex-M0 instruction set. If you had 'pure' code (makes no use of other parts of the system) then code compiled for the M0 would run on the M3
However, the processor tends to be supplied as part of a larger system, such as an MCU - e.g. LPC1114 or LPC1343 - and these systems are typically not compatible, because of the peripherals, memory maps, etc etc.
Also, note that if you recompiled the same code for Cortex-M3 it would almost certainly run faster as the M3 has additional instructions that will allow the compiler to generate better code.
So, the answer is a qualified yes, but it depends on what you are doing and expecting.