Do programming for following task. A switch is connected to pin P1.7. Check the status of the switch and make the following decision. (a) If SW = 0, send “0” to P2 (b) If SW = 1, send “1“ to P2 Test result in SimHardware
ORG 0000H
MOV 90H,#01H ;90H IS THE ADDRESS OF P1 PORT
MOV A,P1
RRC A ;WE CAN ALSO USED RLC INSTEAD OF RRC
JC GO
CLR A
MOV P2,A
SJMP L1
GO:MOV A,#0FFH
MOV P2,A
L1:
END
Comments
Post a Comment
if you have any doubts,please let me know