These should help in the port read write department:
http://www.picbasic.co.uk/forum/show...ight=read+port
http://www.picbasic.co.uk/forum/showthread.php?p=63851
http://www.picbasic.co.uk/forum/showthread.php?t=8734