I had a similar routine once and it worked fine, until the 23rd time pressing the button it would cause the pic to reset. As Demon said, just have the button set a bit to 1 then return. Immediately after the gosub check if the bit is a 1 and if it is then goto wherever you want.