|"OS - Windows XP SP2|
Anti Virus - None"
Why are you still running SP2 & why aren't you running an anti-virus program?
"computer hangs and a blue screen appears"
We need to know the STOP code & error message to be able to help. Otherwise, anything we tell you is just a guess.
"I tried to clear bios memory, but all is in vain"
Of course it was in vain, clearing the BIOS will not fix a Windows problem. Did you enter the BIOS afterwards & manually reconfigure the settings, not just load defaults?
"I has to visit my friend for another computer to format the hard disk and reinstall it to my own computer"
Windows should be installed & setup in the computer it's intended to be run on. Does your friend have an identical computer as yours? Exact same motherboard & hardware? If not, you should NOT be formatting/installing on his computer & then putting the HDD back into yours.