org 0000h ;reset
jmp init_prog
org 000bh ;timer0
jmp t0_isr
org 0100h ;main code starts somewhere else
init_prog:
mov ie,#10000010b ;enables timer0 interrupt
mov tmod,#01h ;TMOD = 0000 0001 which means in low nibble for timer0 mode 1 (16 bits) and soft trigger
mov th0,#4ch ;50ms using clock = 11.059 Mhz
mov tl0,#00h
setb tr0 ;triggers timer0
jmp $
t0_isr:
mov th0,#4ch ;recharge 50ms
mov tl0,#00h
;INSERT YOUR CODE HERE ......
reti ;you don't have to clean the flag TF0 before exit
end