Groundwork for Programmable Behavior
Added State is_programmable
Added State state_programming_enabled
Added State state_executing_script
Added State is_programmed
Added Runtime Routine : runtime_command_exec()
Added System Routine : run , prog
On Boot the system disables is_programmed , is_programmable , state_programming_enabled , state_executing_script
By default , only system commands reset , clear , prog , run , erase , .parse are available , upon usage of prog the system state switches to is_programmable and state_programming_enabled. In this state , the runtime parses user inputs line by line by CR (Carriage Return) and whitespace Delimitation until the Programming Exit Command /prog is used resetting the state to Listener.
By using the run command , if is_programmed is true , a script can be executed from the Programmable Memory Segment (88H-D6H) , the machine state switches from Listener to Active and the Virtual State changes to state_executing_script. The script executes until an exit command (Will be added in the next update) is encountered or the program encounters an error.
The same program can be executed multiple times by using run consecutively however , the prog command erases the Programmable Memory before loading a new program. The same behavior can be achieved by erase command without initiating state changes.
The images below are from future updates and indicate features which are yet to be added , however they are essential for representation of state changes.
By using the prog command , the state changes to enable programming
After using /prog a valid program is compiled and loaded in Programmable Memory waiting for execution
The machine states and virtual states reset after execution of a program