why do we need Do_on_Stack.asm routines for programming flash memory of any controller? what is its importance.. Can anyone please explain me in detail??
For many processors with built-in flash, you cannot be executing code from the same flash memory that you are trying to write to. To work around this problem, the usual procedure is to copy the routines used to do the write-to-flash from flash memory into RAM, and then execute them in RAM while writing to flash memory. The routines you mentioned are designed to perform the copy of the write-to-flash routines into RAM (in this case, the stack).
I hope this helps clear things up.