
IO0     EQU    01h
IO1     EQU    04h
IO2     EQU    10h

  ....
        mov    r2,#IO0
        call   Reset1W
        mov    r2,#IO1
        call   Read1W
  ....
Reset1W:
        mov    a,r2
        cpl    a
        anl    P2,a      ;pulsing line LOW
        call   Delay1
        mov    a,r2
        orl    P2,a      ;pulsing line HIGH
        call   Delay2
        mov    a,P2
        anl    a,r2      ;sampling the input
        ret              ;test acc for zero to get the input bit
....        
