The 628A has comparators on portA. Not sure about the 628. If it does look at this.
http://www.picbasic.co.uk/forum/showthread.php?t=561