Question: Microprocessors and Lab. Throw the Dice program - Explanation: Pressing S2 button starts counting the diceval from 1 to 6 very fast so nobody can
Microprocessors and Lab.
Throw the Dice program - Explanation: Pressing S2 button starts counting the diceval from 1 to 6 very fast so nobody can perceive its value on LEDs. When S2 is released, counting stops and diceval value are observed on PortD in binary format. diceval will be between 1 to 6 . Please write the necessary assembler code for the pseudo code given below. (Please write your code from ORG 0x0000. No need Interrupt or Header files etc...) (SLO3) (25p) a. Do Initializations (Define : diceval is at 070, PortA-2 is S2 button input, PortD is all output to LEDs, set diceval value to one in the beginning.) b. If S2 is held pressed, diceval counts very fast (at processor speed, do no use any delay function.) c. Write diceval to Port D d. Check if the diceval =7. If yes, set diceval to 1 (You can use xorlw and z flag for it) e. If S2 left, diceval counting stops, so the diceval is seen on portd f. Goto step b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
