Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(Please help me answer all of the questions below) 3. Which of the following are

ID: 3864880 • Letter: #

Question

(Please help me answer all of the questions below)

3. Which of the following are advantage of programming in assembly language? (Select all that apply.)

4. During which phase the instruction cycle is an instruction retrieved from memory?

None of the above.

5. Inside the CPU, which register keeps track of where the next instruction fetch comes from?

None of the above.

6. In the ARM chip, register ________ is the stack pointer.

7. Each register in the ARM Cortex CPU programmer's model is ________ bits wide

8. Which instruction would you use to load register R4 with 20000008 hexadecimal?

9. Assume that R8 contains the value 20000000 hexadecimal. Which instruction would you use to load the 32 bit word addressed by R8 + 4 into R1?

10. Assume that R0 contains the hexadecimal value 20000000. If you want to store the 32 bit value in R5 at the address 20000008, without changing the value in R0, which instruction would you use?

11. You are using R1 as a loop counter and you want to add one to the register content. Which instruction would you use?

12. Consider the width of the ARM registers and data bus. The natural size data type for the ARM Cortex family is ________ bits. (Please enter a number.)

13.If our CPU can execute one instruction every 32 ns, how many instructions can it execute in 0.1 s ?

14. If you were translating an if..else statement from pseudocode to ARM assembly language, and the logical operator used in the if was ==, which branch would you use following the CMP instruction?

15. If you were translating an if..else statement from pseudocode to ARM assembly language, and the logical operator used in the if is >, which branch would you use following the CMP instruction?

easy to learn compared to high-level languages

Explanation / Answer

3. All the given given options are advantages of the assembly code, The assembly code is easy to learn , it is highly portable, it has direct access to the hardware for device drivers , It is compact programs and the code works faster .

4. In the instruction cycle the Fetch instruction phase is used to retrieve the next instruction from the memory . The Instruction is loaded into IR.

5. The Program counter (PC) keeps track of the memory address of the next instruction from fetch .

6. In the ARM chip the register R13 is used as the pointer to the active stack .

7. All the general purpose registers in the  ARM Cortex CPU programmer's model are 32 bits wide.

8. The instruction MOV R4, #0x20000008 is used to load register R4 with 20000008 hexadecimal, The ARM instruction can encode an immediate constant that can be represented as an 8-bit immediate value.

9. The instruction LDR R1, [R8, #4] is used to load the 32 bit word addressed by R8 + 4 into R1 , R8 points to the structure base and the  offset specified, the #4, is in bytes .

10. The push instruction MOV [R0], R5, #4 is used to  store the 32 bit value in R5 at the address 20000008, without changing the value in R0 .

11. If R1 is used as the loop counter and 1 is needed to be added to the register content we use the instruction ADDS R1, #1

12. The natural size data type for the ARM Cortex family is of 32 bits which is compiled with with GCC .

13. The number of instructions executed in 0.1 second are 3 125 000, It is given by (1*10-9) /32 =31250000/10 = 3125000 .

14. The branch BGE is used if the logical operator used in the if was ==, It is used to get Signed greater than or equal .

15. The branch instruction BHS is used if the logical operator used in the if is > , it gives the Unsigned comparison having higher or same result.