Planned deprecation of SYSTEM.LNK, SP and PC variables

General discussions about working with the Astrobe IDE and programming ARM Cortex-M0, M3, M4 and M7 microcontrollers.
Post Reply
cfbsoftware
Site Admin
Posts: 497
Joined: Fri Dec 31, 2010 12:30 pm
Contact:

Planned deprecation of SYSTEM.LNK, SP and PC variables

Post by cfbsoftware » Mon Dec 18, 2023 3:40 am

We have discovered some reliability issues while running regression tests on v9.0.4 Astrobe for Cortex-M3, M4 and M7. These are related to the SYSTEM.LNK problem. A number of the instructions generated e.g. TEQ, TST, CMP etc. are documented as, for example:
if n == 15 || m IN {13,15} then UNPREDICTABLE;
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.

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;
could be rewritten as:

Code: Select all

CONST SP = 13;
...
SYSTEM.LDREG(SP, stackStart);
savedSP := SYSTEM.REG(SP) + 8;
Let us know if you have any examples of real-world code that you do not know how to transform.

Post Reply