Re: how the software programe controls a hardware
Woah, bit of a broad scope there. What level are you talking at, how a Java or C# program ends up controlling a CPU or how assembly controls a CPU? Those are two extreme examples but they're very different - you'll have to be a bit more specific here I'm afraid!
Save the whales, feed the hungry, free the mallocs.