If you want to do it at runtime, check out

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