Answered step by step
Verified Expert Solution
Link Copied!

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 10.3 Modify your program from 10.2 by writing a function called flashpattern: that accepts two inputs: the number of "rapid" 1 second flashes before the pause the pause time (in seconds) between each set of rapid flashes We are going to use this function to "re-factor" 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 (i.e., 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 (1| mov R0, #.blue
2| mov R1, #.white
3| mov R2, #1 ; 1sec delay time
4| mov R9, #2
5|reset:
6| mov R8, #0
7|rapid_flashes:
8| PUSH { R8}
9| BL flash
10|jump:
11| add R8, R8, #1
12| CMP R8, #3
13| BLT rapid_flashes
14| POP {R8}
15| PUSH {R0}
16|pause:
17| MOV R0, R9
18| BL delay
19| POP {R0}
20| BL reset
21|flash:
22| str R0,.Pixel367 ; flash on
23| LDR R3,.Time ; start time
24| push {R0}
25| MOV R0, R2
26| BL delay ; call delay function
27| Pop {R0}
28| str R1,.Pixel367 ; flash off
29| LDR R3,.Time ; start time
30| push {R0}
31| MOV R0, R2
32| BL delay ; call delay function
33| pop {R0}
34| B jump
35| halt
36|; Drawpixel function
37|drawpixel:
38| PUSH {R0, R1, LR} ; Push R0, R1, and LR onto the stack
39| STR R0,.Pixel367 ; Set pixel color
40| BL delay ; Call delay function to insert pause
41| STR R1,.Pixel367 ; Turn off pixel
42| BL delay ; Call delay function to insert pause
43| POP {R0, R1, PC} ; Pop R0, R1, and LR from the stack and return
44|delay:
45| push {R3,R4,R5,R6}
46| MOV R3, R0 ; move delay time param into R3
47| LDR R4,.Time ; get start ime
48|timer:
49| LDR R5,.Time ; update time
50| SUB R6, R5, R4 ; calc elapsed time
51| CMP R6, R3 ; compare elapsed to delay time
52| BLT timer
53| pop {R3,R4,R5,R6}
54| RET)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

| In what ways am 1 striving to make their lives better?

Answered: 1 week ago

Question

(8) What am I doing to stretch the high achievers?

Answered: 1 week ago

Question

(9) What am I doing to develop the poor performers?

Answered: 1 week ago