$MOD51
;
; The processor clock speed is 11.059MHz
; Cycle time is 1.1ms

	input_port  equ p2.7
	output_port equ p2.0

	org	00
	ljmp	main

	org 100h
main:

	setb	input_port		;prepare p2.7 for input
        setb    output_port
loop:	mov   	c,input_port		;read the state of p2.7 and
					;store in the carry flag
	cpl	c			;compliment the input
	mov	output_port, c		;transfer p2.7 status to p2.0
	sjmp 	loop

 	end 