refer to other posts that have usefull copy sector , copy page , byte modify routines with this code example

http://www.picbasic.co.uk/forum/showthread.php?t=19286