1. A method of operating a computer to generate a program for an embedded processor comprising: compiling a multitask application with a generic front-end compiler to generate a basic block (BB) control flow graph (CFG) of the multitask application; generating non-preemptive blocks of code from the control flow graph (CFG) with a partitioning module, which blocks of code are defined as AEB (atomic execution blocks) graphs; performing a live variable analysis on the AEB graphs to generate a live variable result; feeding back the live variable result to the partitioning module to refine the AEB graphs until preemption, timing, and latency constraints are met, the AEB graphs having determined AEB nodes; and generating a corresponding executable code for each AEB node in a code generator.