A machine code builder providing improved software controlled power
management is described. A machine code builder reads pre-executable code
and builds machine code from the pre-executable code to maximize a
duration that a resource is not required. The resource(s) not required
may be user defined or the builder can analyze the pre-executable code to
determine which resource(s) are not required. The builder re-organizes
machine code to maximize the time a particular resource is not used.
Mechanisms are also provided to have resource emulation code execute
during re-energizing of a resource to prevent loss of performance.