Button subroutine work properly that u said. but problem in "up" and "down" button. Plz check proteus file. another problem is 7 segment display blanking.