This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Allways 20-bit push multiple is generated

I've built an application for an msp430x2418 MCU using CCS version 4.0.2.01003 without large memory model.

After examining the disassembly listing saw that the generated instructions for push and pop multiple registers for functions are on 20-bits instead of 16-bits (PUSHM.A used instead of PUSHM.W).

Did anyone else encounter this issue and if so do you know what is the status of this?

Thanks,

Alpar

  • This is expected behavior.  When building for MSP430X devices we use a large code model even when we are using a small memory (data) model.  This allows code to be placed above the 64kB boundary.  It also means that function pointers are 20-bits so PUSHM.A and POPM.A must be used to push and pop registers in case a register holds a function pointer.

    Thanks,

    Todd

  • Okay, thanks for the useful explanation. Then it makes sense to always use 20-bit register push/pop instructions.

    Regards,

    Alpar