[New + Review] YLP Unicorn 1.0 (1x18650, LH351D, backlit side switch, magnetic tail, TIR lens, ramping)

This? E-switch UI Development / FSM
I’ve wanted to divide the system part and UI for a long time, so that UI could be written in C and uploaded as application in the binary form. However, I still don’t know, how to implement it in high-level programming languages, where you can’t just point at resources that compiler and linker have the rights to utilize. It is possible to write the system part on Assembly, with loader and API, which calls the UI function with the frequency of the main cycle (60 or 100Hz). But how to write application software in C for this? So that the compiler wouldn’t use registers used in interrupts, so that it wouldn’t try to initialize the stack, etc. It’s easier with Memory: you can explain to the linker where and what to put, but with the core…
Do you have any ideas on this?