Hi jelenacavar,
It is partially true. The HC11 code is highly compatible with HC(S)12 core. CPU12 instructions are a superset of the M68HC11 instruction set.
HCS12 CPU added:
- Stack pointer and program counter offset indexed addressing
- 11 math instructions
- Fuzzy logic instructions
- Long branch instruction (16 bit offset)
- Move instruction (memory to memory)
- Min/max functions
- Bit manipulations for entire memory map
- Exchange/transfer
- Table lookup and interpolate function
- Looping construct
For more details, please look at our application note AN1284 Transporting M68HC11 Code to M68HC12 Devices
http://www.nxp.com/files/microcontrollers/doc/app_note/AN1284.pdf
AN1716 Using M68HC12 Indexed Indirect Addressing
http://www.nxp.com/files/microcontrollers/doc/app_note/AN1716.pdf
CPU12 Reference manual:
http://www.nxp.com/files/microcontrollers/doc/ref_manual/CPU12RM.pdf
The potential highest problem presents different/updated peripherals.
So, it depends on the complexity of your system whether 68HC11 assembly code import or start from scratch will be a better solution.