
$MOD51
;
; The processor clock speed is 11.059MHz
; Cycle time is 1.1ms

	input_port  equ p2.0
	output_port equ p2.7

	org	00
	ljmp	main

	org 100h
main:

; Initialize the SFRs first
;
	mov	scon,#50H 		;mode 1, recv enable
	mov 	tmod,#70H		;timer 1 in auto reload
	mov	pcon,#80H		;double baud rate
	mov 	th1,#0FDH		;19,200 baud at 11.059MHz
	mov	tcon,#40H		;start timer 1
	clr 	ti			; clear for Xmitting

	setb	input_port		;prepare p2.0 for input
loop:	mov   	c,input_port		;read the state of p2.0 and
					;store in the carry flag
	cpl	c			;compliment the input
	mov	output_port, c		;transfer p2.0 status to p2.7
	sjmp 	loop



