LOOP: MOV TCOUNT,#20 
SETB TR0 
JNB ALARM,$ 
; here you need to reset ALARM bit again
; before repeat the loop otherwise
; TCOUNT will be reloaded permanently after first itteration
JMP LOOP