The AT89S8252 has a build in watchdog timer.
A watchdog timer is a timer that will reset the uP when it reaches a certain value.
So during program execution this WD-timer must be reset before it exceeds its maximum value. This is used to be sure a program is running correct.
When a program crashes or sits in an endless loop it will not reset the WD-timer so an automatic reset will occur resulting in a restart.
CONFIG WATCHDOG = value
value The time in
mS it takes the WD will overflow, causing a reset.