TSR - Terminate and Stay Resident for fx-9860G

It is possible to write an addin (in C / asm), which cooperates with CASIO basic interpreter.
This allows following features:

I wrote simple program, which demonstrates this ability.
Please take it more as a proof of concept than as a complete solution. I hope another developers use this idea.

Program behaviour:
The program goes to programming mode (Menu-B), creates a new file "TSRDEMO" and writes simple script here.

Then it exits the editor and run this script. To make the whole thing more cool it scrolls the screen.

You may press [Menu] and you will see scrolling menu screen:

Please do not activate another menu items now, TSR would crash. To quit scrolling press [EXE]. This deactivates TSR addin. Now you can use any menu application.
Note: if you want to run it again, please delete "TSRDEMO" script first
TSR addin was tested in CASIO SDK (runs slow) and fx-9860G SD with fx-9860G II firmware (runs normal).

Detailed description:
Look the source code ;-). Main steps are: