Answered step by step
Verified Expert Solution
Question
1 Approved Answer
file Edit View Project Flash Debug Peripherals Tools SVCS Window Help @ Project h: Project: Lab-12 Target 1 1 Write a macro that will calculate
file Edit View Project Flash Debug Peripherals Tools SVCS Window Help @ Project h: Project: Lab-12 Target 1 1 Write a macro that will calculate the sum of the array and the average of the array Target 1 AREA Lab12_YourFirstName YourLastNane, CoDE, READONLY EXPORT main Source Group 1 CMsis Array i DCD 3, -7, 2, -3, 10 ti Device Array 1 Size DCD 5 7Array_1_Pointer DCD Array1 Array 2 DCD -8,43, -3 DCD 3 9 Array 2 Size 10 Array_2_Pointer DCD Array 2 1Array 3 12 Array 3 Size 13 Array_3_Pointer DCD Array_3 14 DCD 9, 34, 2. 6, 2, 8,2 DCD 7 16 Call your macro here for Array 1 Data: Use R5 for Sum of the Array, Use R6 for the Average of the Array 17Call your macro here for Array Daza: Use R7 for Sum of the Array, Use RB tor the Average of the Array 18 Call your macro here for Array 3 Data: Use R9 for Sum of the Aray, Use R10 for the Average of the Array 19 8top B atop 20 21 Step 1: 2 Replace the 1at highlighted section with your Hacro. 23 (1) You may use some or all of the foiloing register5 as cemporary variables inside your macro: 24 5) Your macro must have the correct needed input parameters and result regiater 26 27 28 (3)I recommend that you first solve the problem without Macro, then create your macro. 29 )How o point to the array7 30 END RO, Rl,R2. R3, R4 Inputs: Array Siz and the Array Results: Sum of the array and the Average of the array You need to u e LDR to point to the Array Pointer Example Of course, you will need to use your parameter names): DR RO Array 1_Pointer: Now RO 1s pointing to the base address LDR RI, Array 1Size 32 Step 2 5 Replace the nd highlighted section with your 3 calls of your Macro 36 . You are NOT allowed to modify your main EXCEPT for the 3 line that will call your macro. 37 2 You ahould paas the array parameter and not the actual array 38 3. For the re,ults, use the reg1 ter mentioned In the highlighted section 39 4 How to pass the data to your Macro. 40 You juat need to pas8 the label name, Example: Array_1_Pointer, Array 1_31ze 0 Type here to search 4:27 PM 11/20/2017 ^ file Edit View Project Flash Debug Peripherals Tools SVCS Window Help @ Project h: Project: Lab-12 Target 1 1 Write a macro that will calculate the sum of the array and the average of the array Target 1 AREA Lab12_YourFirstName YourLastNane, CoDE, READONLY EXPORT main Source Group 1 CMsis Array i DCD 3, -7, 2, -3, 10 ti Device Array 1 Size DCD 5 7Array_1_Pointer DCD Array1 Array 2 DCD -8,43, -3 DCD 3 9 Array 2 Size 10 Array_2_Pointer DCD Array 2 1Array 3 12 Array 3 Size 13 Array_3_Pointer DCD Array_3 14 DCD 9, 34, 2. 6, 2, 8,2 DCD 7 16 Call your macro here for Array 1 Data: Use R5 for Sum of the Array, Use R6 for the Average of the Array 17Call your macro here for Array Daza: Use R7 for Sum of the Array, Use RB tor the Average of the Array 18 Call your macro here for Array 3 Data: Use R9 for Sum of the Aray, Use R10 for the Average of the Array 19 8top B atop 20 21 Step 1: 2 Replace the 1at highlighted section with your Hacro. 23 (1) You may use some or all of the foiloing register5 as cemporary variables inside your macro: 24 5) Your macro must have the correct needed input parameters and result regiater 26 27 28 (3)I recommend that you first solve the problem without Macro, then create your macro. 29 )How o point to the array7 30 END RO, Rl,R2. R3, R4 Inputs: Array Siz and the Array Results: Sum of the array and the Average of the array You need to u e LDR to point to the Array Pointer Example Of course, you will need to use your parameter names): DR RO Array 1_Pointer: Now RO 1s pointing to the base address LDR RI, Array 1Size 32 Step 2 5 Replace the nd highlighted section with your 3 calls of your Macro 36 . You are NOT allowed to modify your main EXCEPT for the 3 line that will call your macro. 37 2 You ahould paas the array parameter and not the actual array 38 3. For the re,ults, use the reg1 ter mentioned In the highlighted section 39 4 How to pass the data to your Macro. 40 You juat need to pas8 the label name, Example: Array_1_Pointer, Array 1_31ze 0 Type here to search 4:27 PM 11/20/2017 ^
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