SYSTEM Extensions

General discussions about working with the Astrobe IDE and programming ARM Cortex-M0, M3, M4 and M7 microcontrollers.
Post Reply
gray
Posts: 109
Joined: Tue Feb 12, 2019 2:59 am
Location: Mauritius

SYSTEM Extensions

Post by gray » Wed Jun 19, 2019 12:36 pm

Astrobe's SYSTEM offers easy access to the PC, LNK, SP, and FP registers, both readable and writable, which is very -- very! -- useful to muck around with separate stacks for each process, exception handling (errors, faults), and other low level code of that nature.

To separate the process stacks (thread mode) from the stack used by the exception handlers (handler mode), access to the PSP, MSP, and CONTROL registers is required. It would be useful to access these registers without resorting to EMIT wizardry.

Would it be a big effort to extend SYSTEM accordingly (SYSTEM.PSP, SYSTEM.MSP, SYSTEM.CONTROL)?

And, extending the question, what about the other Special Registers (PSR, PRIMASK and friends)?

cfbsoftware
Site Admin
Posts: 493
Joined: Fri Dec 31, 2010 12:30 pm
Contact:

Re: SYSTEM Extensions

Post by cfbsoftware » Wed Jun 19, 2019 1:16 pm

The reason we provided SYSTEM.EMIT was to enable you to implement rarely-used system functions like this for yourself. There was a similar, but different, request in the past - see the topic titled SYSTEM function for special register for more information.

Post Reply