MOV P0,#0FFH                     ;make port 0 input