Friday, July 22, 2011

A switch is connected to pin P1.7. WAP to continuosly check status of switch and send 'Y' or 'N' to P2


; P1.7 HAS SWITCH CONNECTED TO IT
; CONSIDER 1 AS ON 0 AS OFF
BACK: JB P1.7, LABEL ;
MOV P2, #'N' ;
SJMP -BACK ; MINUS SIGN REPRESENTS BACKWARD JUMP
LABEL: MOV P2, #'Y' ;
SJMP -BACK ;
; END OF PROGRAM 

No comments:

Post a Comment