Hi,
Is there any way to force CCS compiler to generate "near" functions with RET instead of RETA at the epilogue inspite of large data/code model is used? I am writing a small and fast task scheduler which uses 16-bit type to keep user defined callback function (uint16_t). I tell the linker to place these functions within first 64-kB of the address space. Before calling such function I use type casting to void (*)()
static __inline void _call_addr16(uint16_t addr) { ((void (*)()) addr)(); }
The compiler generates the CALL instruction instead of CALLA. Unfortunately the callee uses RETA so the stack is corrupted after return. Is it possible to fix it without writing raw assembly?
Thanks in advance,
Matthew