where 15 is PC and 13 is SP. The behaviour is intermittent. For example one test worked OK on M3 and M4 but produced a usage fault on M7.if n == 15 || m IN {13,15} then UNPREDICTABLE;
Consequently we are planning to deprecate the SYSTEM.LNK, SYSTEM.SP and SYSTEM.PC variables in the next feature release of Astrobe for Cortex-M in 2024. If you are using these variables you should replace them with the inline functions SYSTEM.REG and SYSTEM.LDREG as soon as is convenient. For example:
Code: Select all
SYSTEM.SP := stackStart;
savedSP := SYSTEM.SP + 8;
Code: Select all
CONST SP = 13;
...
SYSTEM.LDREG(SP, stackStart);
savedSP := SYSTEM.REG(SP) + 8;