for the programs that I have read, everytime a function returns a value to eax (or other), the program saves it in RAM immediately. multitasking is like, when a window is waiting for message from user or another window, Windows can give control of CPU to another program. Surely a CPU cannot process more than one program at one time, in other words it does everything one by one and sometimes leave one alone and come back later. whenever a program is "hung up", it's paused and the registers clear.