If you mean not to use _Startup routine then….
In the originally attached example you have function interrupt 2 void WatchDogIsr(void)
I’ll simplify it a little bit.
//********************************************************************
#pragma CODE_SEG NON_BANKED
interrupt 2 void WatchDogIsr(void)
{
// any local variable created in this function which is not static // causes error because stack is not initialized after reset. Use
// global variables which exists everytime on defined addresses.
// Be aware that all registers are set to the RESET status.
// The RAM remains unchanged.
INIT_SP_FROM_STARTUP_DESC();
asm JMP FunctionForMyNewStart; // the best is to use near function
}
#pragma CODE_SEG DEFAULT
//********************************************************************
#pragma CODE_SEG NON_BANKED
void FunctionForMyNewStart(void)
{
// I have rest status of registers and Stack set to initial value
// Everything is up to me now
// jump/call/do what you want
}
#pragma CODE_SEG DEFAULT
//********************************************************************
Best regards,
Ladislav