;Program for implementing staircase lightcontrol
clr p2.1 ;Configuration of port pin P2.1 as output
setb p1.1 ;Configuration of port pin P1.1, P1.2 as inputs
setb p1.2
; Perform XOR operation
L1: mov c, p1.1
anl c, /p1.2
mov 00h, c
mov c, p1.2
anl c, /p1.1
orl c, 00h
; Staircase light control
mov p2.1, c
sjmp L1