Question: Assume that a switch is connected to pin P1.4 and a value stored in R5. Write a program that checks that status of the switch
Assume that a switch is connected to pin P1.4 and a value stored in R5. Write a program that checks that status of the switch continuously, if the switch is ON decrement the value of R5 and send the value to P2 and the complement to P3. The program stops when the value of R5 reaches zero. 3. Write a program to add contents of 5 memory locations from location 40H onwards. The program then stores the result in R6 and sends it P2. If the final carry, after adding all of the values, equals to1 then set the bit 2AH in the memory 4. Write a program that reads a number from 8 switches connected to P2 then counts number of 1's in that number to display it as a binary number on 8 LEDs connected to 5. P3. Include a subroutine in your program to do the task of counting the 1's
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
