PURPOSE: To increase the task switching speed by constituting a program in a form of short subroutines and switching the program execution only in a designated position during execution of the program.
CONSTITUTION: All of a program main body 10 is described in a form of short subroutines, namely, with threads 1, 2.... Positions where the program can be interrupted and restarted are defined in these threads 1, 2... by symbols A, B.... In these positions, it is unnecessary that contents of a CPU register, etc., just after interruption are equal to those just after restart. While the processing in threads 1, 2... is executed, program (task) switching is executed only in designated positions but is not executed in positions other than designated positions. Consequently, it is unnecessary to save and restore CPU internal registers at the time of program switching.