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 AEBs (atomic execution blocks); performing a live variable analysis on the AEB graphs to generate a live variable result; feeding back to the live variable result to the partitioning module to refine the partitions until acceptable preemption, timing, and latency are achieved, the AEB graphs having determined AEB nodes; and generating a corresponding executable code for each AEB node in a code generator.