Question 4.7: A switch is connected to pin P1.0 and an LED to pin P2.7. Wr...

A switch is connected to pin P1.0 and an LED to pin P2.7. Write a program to get the status of the switch and send it to the LED

The blue check mark means that this solution has been answered and checked by an expert. This guarantees that the final answer is accurate.
Learn more on how we answer questions.

SETB   P1.7        ;make P1.7 an input

AGAIN:      MOV   C,P1.0    ;read SW status into CF

MOV   P2.7,C    ;send SW status to LED
SJMP AGAIN   ;keep repeating

The instruction ‘MOV P2.7,P1.0’ is wrong , since such an instruction does not exist

However ‘MOV P2,P1’ is a valid instruction

Related Answered Questions