Patent ID: 7496738

Claim:
A method of automatic control of execution of a program by a microprocessor, comprising: assigning a digital decrement to at least one function of the program and a digital increment to at least one section considered as critical as to the program execution and called by the at least one program function, or assigning a digital increment to the at least one program function and a digital decrement to the at least one section, wherein a magnitude of the digital decrement or increment assigned to the at least one section depends at least in part on how critical is the at least one section, and wherein the at least one section can be assigned more than one different digital decrements or increments depending on a function of the program that calls the at least one section; setting a counter to a first value; modifying a current value of the counter once per execution of the at least one program function before a call to the at least one critical section, by a value of the decrement or increment assigned to the at least one program function; when the current value of the counter is modified once per execution of the at least one program function before the call to the at least one critical section by a value of the decrement assigned to the at least one program function, modifying the current value of the counter on each correct execution of the at least one critical section by a value of the increment assigned to the at least one critical section; when the current value of the counter is modified once per execution of the at least one program function before the call to the at least one critical section by a value of the increment assigned to the at least one program function, modifying the current value of the counter on each correct execution of the at least one critical section by a value of the decrement assigned to the at least one critical section; and comparing the current value of the counter with a predetermined critical threshold.