
org 0h

;configuring serial communication-----start-----
mov tmod,#20h     ;t1mer1 mode2.
mov th1,#0fdh     ;baud rate=9600bps.
mov scon,#50h     ;mode1, 8-bit data,1-start & 1-stop bit,REN(reception) enabled.
setb tr1
again:clr ri
here:jnb ri,here  ;wait till the command is received.
mov a,sbuf        ;copy the command.
;configuring serial communication-----end-----

cjne a,#'y',next
mov p0,#0aah      ;toggle LEDs connected @ port0

next:cjne a,#'n',next1
mov p0,#55h       ;toggle LEDs connected @ port0

next1:sjmp again
end
