Computer problems

I’ve been having problems with my computer. THey seem to be random.

First my computer would tell me that my registry is corrupt randomly when I’d turn on my computer… And no, I didn’t install any new programs that would cause this problem. I reformatted and everything. NOW there is another problem. When I turn on my computer all of a sudden during the boot screen (with the blue bars moving and it says Windows XP Professional) the computer restarts. Right before the computer restarts this long error message appears for less than a second. The error message is yellow text on a blue background.

Sorry if that’s written poorly. Does anyone have a solution?