Hi i use SW reset command in my code. after reset, PC is set to address 0x0000. unfortunately at this address i can't find nor main{} neither JMP to main. which are the tools i can use (startup.a51 or others) in order to direct the program on address 0x0000 to main{}?
the problem with the watchdog mechanism is one can't make any action prior the watchdog reset.
Doing other actions in the watchdog ISR is wrong on two counts: first of all, doing time-consuming things or calling other functions from inside an 8051 ISR is a fat big no-no. Second, those particular things you're talking about are a bad idea to do once a watchdog has timed out.
If the watchdog has to bite, that's your last and only sign that your application, and all of its state variables, are seriously corrupted already. Saving that corrupt state to flash will only make matters worse, not better. Don't do that.