Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE sole it using PUSH & POP with ONLY 1-REGISTER. thanks in advance. This program blinks LEDs every half second (500 msec approx.) ORG 0000H
PLEASE sole it using PUSH & POP with ONLY 1-REGISTER.
thanks in advance.
This program blinks LEDs every half second (500 msec approx.) ORG 0000H ; After reset, start fetching instructions from OOH MOV A, #55H ; load B01010101 in A MOV DPTR, #0FF00H ; LEDs 00-07: controlled by FF00H memory address AGAIN: MOVX @DPTR, A ; move A to memory address 50% Duty Cycle ACALL DELAY 500ms ON ; call delay routine 500ms OFF CPL A ; invert A to 1010 1010 1 1 SJMP AGAIN ; repeat blinking f = 1 Hz T 1000ms DONE: SJMP DONE DELAY: OUTER2: OUTER1: INNER: ; this routine implements a delay of 500ms MOV R4, #05 ; move 5 in R4, 1 MC (machine cycle) MOV R3, #200 ; move 200 in R3, 1 MC MOV R2, #255 ; move 255 in R2, 1 MC DJNZ R2, INNER ; decrement R2 until 0,2 MC DJNZ R3, OUTER1 ; decrement R3 until 0,2 MC DJNZ R4, OUTER2 ; decrement R4 until 0, 2 MC RET END 3. Rewrite the procedure DELAY with the same duration, but using only 1 register RO instead of 3 registersStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started