
mytable CODE    0A000h
resetv  XDATA   0000h

        ...

        mov r0,#026h          ; bytes to copy 26h-1
        mov r1,#025h          ; lower byte of destination address
	mov dptr,#mytable     ; DPTR points into my Flash
copyloop:
	mov A,r0              ; load offset into my original table
	movc A,@A+dptr        ; get byte from code space
	mov P2,#(resetv SHR 8) ; set upper byte of reset vector to the XRAM bus
	movx @r1,A            ; lower byte on bus = offset - write the byte from CODE space there
        dec r1                ; decrement destination pointer
	djnz r0,copyloop      ; loop for all bytes in charge
