1. A method for controlling the execution of a computer program, having multitasking capability, on a computing element of a controller for at least one of controlling and regulating a system that can take up various possible system states, comprising: subdividing the computer program into a plurality of functionally linked functionalities; defining possible operating states for the functionalities; defining possible system states of the system; allocating specifiable operating states to the functionalities for each system state; ascertaining dependencies of the functionalities on one another, a first functionality being dependent upon a second functionality if at least one input variable of the first functionality is ascertained in the second functionality; and centrally specifying the operating states required for a certain system state, taking into consideration the ascertained dependencies among the functionalities and further boundary conditions.