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

Popular posts from this blog

Wire wound strain gauge

SemiConductor type strain gauge

Do an ALP to compare two eight bit numbers NUM1 and NUM2 stored in external memory locations 8000h and 8001h respectively. Reflect your result as: If NUM1NUM2, SET MSB of location 2FH (bit address 7FH). If NUM1 = NUM2, then Clear both LSB & MSB of bit addressable memory location 2FH.