I think this is what you are looking for. In the manual under "Ports and other Registers".
$0f = 00001111Code:anyvar = PORTB & $0f 'Isolate lower 4 bits of PORTB and place result into anyvar
$00ff = 11111111
Now you can check "anyvar" for changes.
Bookmarks