The fastest way for saving the registers would be something like this
pshh ;save h 2
pshx ;save x 2
psha ;save a 2
tpa ;get a copy of the status register 1
psha; and save it 2
tsx; get stack pointer to hx 2
sthx savedSP ;save the stack pointer 4
So it would take 2+2+2+1+2+2+4 = 15 clock cycles or 0.75 uS on a 20 Mhz 9S08.
In the savedSP word the SP should be saved so when the CPU is powered up, it first checks the savedSP word. If it is < 0xffff, the saved data can be restored. If = 0xffff, no data has been saved.
Regards,
Ake