Search This Blog

Saturday, August 27, 2011

A Switch is connected to P1.7. WAp to check status of switch and perform the following


; A Switch is connected to P1.7.  WAp to check status of switch and ;perform the following
; 1 if switch = 0, send letter 'N' to P2
; 2 if switch = 1, send letter 'Y' to P2


START : JNB P1.7, ONN ;
MOV P2, #'y' ;
SJMP START ;
ONN :   MOV P2, #'n' ;
SJMP START ;
END

No comments:

Post a Comment