$include (C8051F410.INC) LED EQU P0.2 CSEG at 0000h jmp Main Main: anl PCA0MD, #0BFh ; watchdog off mov PCA0MD, #000h mov XBR1, #040h ; crossbar on Main1: cpl LED ; complement LED call Wait1sec jmp Main1 ; repeat forever Wait1sec: mov TMOD,#001h ; Timer 0 mode is 16-bit timer clr TR0 ; stop timer mov TH0,#0C1h ; wait time = 65536-(TH0*256+TL0)/(sysclk/12) mov TL0,#0B1h ; clr TF0 ; clear overflow flag setb TR0 ; start timer 0 jnb TF0,$ ; wait for overflow clr TF0 ; clear overflow flag clr TR0 ; stop timer 0 ret END