M1	bit p1.0  ;M1 and M2 is motor polarity
M2	bit p1.1
TLS	bit p1.2  ;TLS=top limit switch
BLS	bit p1.3  ;BLS=bottom limit switch
SB	bit p1.4
start:	clr M1
	clr M2
	jb SB,up
	jmp start
up:	setb M1
	jb TLS,up
	clr M1
	setb M2
down:	jb BLS,down
	clr M2
	ret	
end