What's the point of saving FSR0 when you must know it before restoring:
// Save registers
asm("movwi 0[FSR0]");
asm("movf BSR, W");
asm("movwi 1[FSR0]");
asm("movf FSR0H, W"); // this is redundant
asm("movwi 2[FSR0]"); // this is redundant
asm("movf FSR0L, W"); // this is redundant
asm("movwi 3[FSR0]"); // this is redundant
asm("movf FSR1H, W");
asm("movwi 4[FSR0]");
asm("movf FSR1L, W");
asm("movwi 5[FSR0]");
When you restore, the FSR0 is already set when you start restoring, so:
asm("moviw 1[FSR0]");
asm("movwf BSR");
asm("moviw 2[FSR0]"); // this does nothing
asm("movwf FSR0H"); // this does nothing
asm("moviw 3[FSR0]"); // this does nothing
asm("movwf FSR0L"); // this does nothing
asm("moviw 4[FSR0]");
asm("movwf FSR1H");
asm("moviw 5[FSR0]");
asm("movwf FSR1L");
asm("moviw 0[FSR0]");