one way



oldportb var byte
pbchange var byte


in main before isr enabled
oldportb=portb





in isr {portb must have changed to get here}


pbchange = portb ^ oldportb ; xor portb with last known state and set bits that changed

oldportb=portb ;update state
pbchange=pbchange>>4 ; shift result to low byte

int returm