Page 1 of 1

SYSTEM Extensions

Posted: Wed Jun 19, 2019 12:36 pm
by gray
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)?

Re: SYSTEM Extensions

Posted: Wed Jun 19, 2019 1:16 pm
by cfbsoftware
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.