{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Example Test Questions - SUB R1,R1#1 CMP R1#0 BNE LOOP LDR...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Example Test Questions 1. Write a program for the ARM processor to add a list of 5 32 bit unsigned words and store the sum in a word variable. Your program should zero a 32 bit variable in memory if the result is not valid or set it equal to 1 if valid. Explain what can happen to produce an incorrect sum, buy giving an example of such a list. Marks will be given for useful comments as well as for the code. 2. Explain in detail what the code below does. For full credit you must write a useful comment for each line of the program, and explain the overall operation of the program. .text .global _start _start: LDR R1,=SIZE LDR R1,[R1] LDR R2,=VEC MOV R0, #0 LOOP: LDR R3,[R2] ADD R0,R0,R3 ADD R2,R2 ,#4
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: SUB R1,R1, #1 CMP R1, #0 BNE LOOP LDR R1,=TOT STR R0, [R1] DONE: B DONE .data .align SIZE: .word 3 VEC: .word 3, -1, 2 TOT: .skip 4 .end 3. Assume the following register memory contents in an ARM computer: Register R0 contains 1000 Register R1 contains 2000 Register R2 contains 1016 Register R6 contains 20 Register R7 contains 30 The numbers 1, 2, 3, 4, 5, and 6 are stored in successive word locations starting at memory address 1000. What is the effect of executing each of the following two short instruction blocks starting each time from the given initial values? (A) LDR R8, [R0] LDR R9, [R0,#4] ADD R10,R8,R9 (B) STR R6,[R1,#-4]! STR R7,[R1,#-4]! LDR R8,[R1],#4 LDR R9,[R1],#4 SUB R10,R8,R9...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern