
.org	0x0000

mov TMOD, #20H  ;T1 is mode2
mov TH1, #-96   ; 300 baud
mov SCON, #50H  ;8b, 1stop, 1start, REN enabled
setb TR1        ;start timer T1

clr TI     ;clear the "transmitted" bit

hello:
mov SBUF, #'H'  ;gimme an H!
acall wait      ;wait until the letter is sent
mov SBUF, #'E'
acall wait
mov SBUF, #'L'
acall wait
mov SBUF, #'L'
acall wait
mov SBUF, #'O'
acall wait
mov SBUF, #' '  ;space
acall wait
mov SBUF, #'W'
acall wait
mov SBUF, #'O'
acall wait
mov SBUF, #'R'
acall wait
mov SBUF, #'L'
acall wait
mov SBUF, #'D'
acall wait
mov SBUF, #' '  ;space
acall wait
mov SBUF, #' '  ;space
acall wait

ajmp hello  ;say it again

wait:
JNB TI, wait
clr TI
ret

