       ACALL KEYPRESSED;       ; to check whether any key is pressed or not
       JNZ CALCULATE           ; if key is pressed then jump to calculate to check is the key     

                               ; pressed is valid key or the previous key is kept pressed till    

                               ; now
       JMP ALTER;              ; If no key is pressed then clear the flag which check whether the 

                               ;  previous key is kept pressed till now

CALCULATE:
       ACALL KEYPRESSED        ; again check whether key is pressed or not