This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Return instruction of CALLA

Hi All

I'm looking for an issue in a code written in C and I think it might be due to the compiler. For this SW I'm using c166 V3.05a (an old legacy code).

The compiler calls one function with CALLA instruction but the return instruction is RETS (I think should be RET).
I think that this cause a spurious value into the stack that in some case create error in the other part of the code.

The code that cause this is like
BYTE* funct();
BYTE * p_a;
BYTE funct_val();

*(p_a = funct()) = funct_val();

The compiler call funct() with a CALLA instruction (and the function return with RETS)

if i change it with

p_a = funct()
*(p_a) = funct_val();

funct() is called with CALLS (and the function return with RETS)