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 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s