contact bounce can be marginalized with a short pause. IOC would trigger going to either logic state and his output would always start out at what it is initialized to. If he is not too worried about latency then even ON INTERRUPT would work, though I prefer Darrel's asm interrupts.