Sten Siren

Entry code

Discussion created by Sten Siren on May 17, 2006
Latest reply on May 19, 2006 by CompilerGuru
CW for HC12 v. 4.5 build 6039
I have the following function:
void memfill(BYTE c) {    asm {  ldaa c
  ......    }    return;}

 This was by CW for HC12 v. 3.1 compiled to

 which did work, but v. 4.5 compiles to
which does not work because the function parameter 'c' does not get saved to the stack and thus the LDAA 0,SP will load something undefined.
I have in the same file an other routine which also returns the c-value, and that routine works on both versions.
This is clearly some kind of optimizing issue, but what optimization option could I use to get the PSHB back?