5. List the values that will be in int array A with n = 10? void fillByUnkown (int A[], int n) { asm volatile( A[0]. "movw r30, BA0 \n\t "ldi r16, 0 \n\t //z holds &A[0] //this will be our loop counter A[1] "ldi r26, 10 \n\t // ldi r27, 0 \n\t // A[2]. 1di r25, 0 \n\t // "push r30 \n\t //store z, the beginning of the array on the sta "push r31 \n\t A[3] "top: cp r16, 8A1 \n\t // i-n // // : //output variables "brge out&= \n\t //no branch if greater so reversed the cp order "movw r24, r26 \n\t // "st z+, r24 \n\t" "st z+, r25 \n\t "adiw r26, 5 \n\t "inc r16 \n\t "rimp top \n\t "out: clr r1 \n\t "pop r31 \n\t "pop r30 \n\t "ldi r16, 99 \n\t" "std z+14, r16 \n\t" "ldi r16, 0 \n\t" "std z+15, r16 \n\t" "eor rl, rl \n\t : "z" (A), "r" (n) //store the low byte, move z to the high byte //store the high byte, move z to the next element // //inc counter by 1 // bottom of the loop // // restore z to point to A[0] A[4] A[5]. A[6] A[7] //this is to test if you understand // how storing with displacment works! A[8] //store the high byte A[9] //note that z is a pointer to our array A : "r16", "r26", "r27", "r24", "r25" //clobber list
5. List the values that will be in int array A with n = 10? void fillByUnkown (int A[], int n) { asm volatile( A[0]. "movw r30, BA0 \n\t "ldi r16, 0 \n\t //z holds &A[0] //this will be our loop counter A[1] "ldi r26, 10 \n\t // ldi r27, 0 \n\t // A[2]. 1di r25, 0 \n\t // "push r30 \n\t //store z, the beginning of the array on the sta "push r31 \n\t A[3] "top: cp r16, 8A1 \n\t // i-n // // : //output variables "brge out&= \n\t //no branch if greater so reversed the cp order "movw r24, r26 \n\t // "st z+, r24 \n\t" "st z+, r25 \n\t "adiw r26, 5 \n\t "inc r16 \n\t "rimp top \n\t "out: clr r1 \n\t "pop r31 \n\t "pop r30 \n\t "ldi r16, 99 \n\t" "std z+14, r16 \n\t" "ldi r16, 0 \n\t" "std z+15, r16 \n\t" "eor rl, rl \n\t : "z" (A), "r" (n) //store the low byte, move z to the high byte //store the high byte, move z to the next element // //inc counter by 1 // bottom of the loop // // restore z to point to A[0] A[4] A[5]. A[6] A[7] //this is to test if you understand // how storing with displacment works! A[8] //store the high byte A[9] //note that z is a pointer to our array A : "r16", "r26", "r27", "r24", "r25" //clobber list
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 23SA
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr