Check your
Event Viewer via
Administrative Tools.
Open the
System as well as
Application tabs and look for red
X errors that coincide with your problem. Details here:
How to view and manage event logs in Event Viewer in Windows XP
Basic information on Event Viewer errors can be found here:
EventID.Net
Also turn off the auto restart function:
How to turn off Auto Restart in XP
Right click on My Computer
Select Properties
Select the Advanced tab then the Startup & Recovery section
Select the Settings button
Uncheck "Automatically restart" and then click Apply
If this is a software problem this should give you a
Blue Screen with the error message rather than restarting the computer.
Write down the error detail then use the reset button on the computer to restart.