Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ProcessorExcercise 1 0 . 3 Modify your program from 1 0 . 2 by writing a function called flashpattern: that accepts two inputs: the number
ProcessorExcercise Modify your program from by writing a function called flashpattern: that accepts two inputs: the number of "rapid" second flashes before the pause the pause time in seconds between each set of rapid flashes We are going to use this function to refactor" our main code. That is instead of the flash loop in main, we are asking you to move that logic to a function called "flashpattern" following the description above. Once done, the main Processor code should now just set up the arguments to flashpattern:, and then call flashpattern to do all the work ie flash, delay using the previous functions you wrote to perform the task need help solving this Excercise this my code so far using armlite simulator assembly can get help using armlite simulator assembly not python mov R #blue
mov R #white
mov R # ; sec delay time
mov R #
reset:
mov R #
rapidflashes:
PUSH R
BL flash
jump:
add R R #
CMP R #
BLT rapidflashes
POP R
PUSH R
pause:
MOV R R
BL delay
POP R
BL reset
flash:
str RPixel ; flash on
LDR RTime ; start time
push R
MOV R R
BL delay ; call delay function
Pop R
str RPixel ; flash off
LDR RTime ; start time
push R
MOV R R
BL delay ; call delay function
pop R
B jump
halt
; Drawpixel function
drawpixel:
PUSH R R LR ; Push R R and LR onto the stack
STR RPixel ; Set pixel color
BL delay ; Call delay function to insert pause
STR RPixel ; Turn off pixel
BL delay ; Call delay function to insert pause
POP R R PC ; Pop R R and LR from the stack and return
delay:
push RRRR
MOV R R ; move delay time param into R
LDR RTime ; get start ime
timer:
LDR RTime ; update time
SUB R R R ; calc elapsed time
CMP R R ; compare elapsed to delay time
BLT timer
pop RRRR
RET
Step 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