Hi all
In my asm function, I want to store the A10-A15 to SP at beginning, and before return I will read back the data from SP.
Following is my test function. My program flow is
.... // other functions
stackTest();
.... // other functions
when compile program as debug, the program can run correctly. But is compile as release, the program can't stop, as the PC is point to wrong address.
_stackTest:
;<Cycle 1>
STDW .D2T1 A11:A10, *B15_SP--
;<Cycle 2>
STDW .D2T1 A13:A12, *B15_SP--
;<Cycle 3>
STDW .D2T1 A15_FP:A14, *B15_SP--
;<Cycle 4>
ADD .S1 A4_a, A4_a, A14_sdf
;<Cycle 5>
LDDW .D2T1 *B15_SP++, A15:A14_sdf
;<Cycle 6>
LDDW .D2T1 *B15_SP++, A13:A12
;<Cycle 7>
LDDW .D2T1 *B15_SP++, A11:A10
;<Cycle 8>
NOP
;<Cycle 9>
NOP
;<Cycle 10>
NOP
;<Cycle 11>
NOP
;<Cycle 12>
B .S2 B3_retAddr
;<Cycle 13>
NOP
;<Cycle 14>
NOP
;<Cycle 15>
NOP
;<Cycle 16>
NOP
;<Cycle 17>
NOP