Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following question is using ARM assembly language: Part 3 of 4 Assume that A, B, C, D, and Z are 32-bit values in memory.

The following question is using ARM assembly language:image text in transcribedimage text in transcribed

Part 3 of 4 Assume that A, B, C, D, and Z are 32-bit values in memory. You can initialize them by using a DCD directive. Remember, you can use a label to define the first location of a memory block. Note that you can put multiple values after the directive DCD or DCB, but you need to separate the values with commas. However, since each data item requires its own name, you have to use one directive per element, e.g., DCD value B DCD value DCD value D DCD value 2 DCD value Modify your program in part 2 to load (LDR) the values of r1 to r4 using these A, B, C, and D values, respectively. You also need to store (STR) the result in location Z. Use the Keil simulator to write, assemble, and run the above program To see the content of a memory segment, you need to open a memory window. To do this, while you are in the debugging mode, click on View, then select Memory Window and then Memory 1. Enter the starting address in the Address box in the memory window (which is 0) and hit return. In the memory window, we can see both the code and data. Note that you may need to resize the memory window, by dragging the edge of the memory window to display as many or as few bytes per line as you want. In Keil simulator, memory locations are read-only, by default. To change some of these locations to read-write, we have to perform an additional step. Click the Debug and then the Memory Map tabs. Enter a memory map range in the Map Range box and check the box Read, and Write, as needed, and finally click on the Map Range button. The format of the range is defined as 0x000,0x200, for example. This range is from memory location 0x000 to memory location 0x200. This step must be performed each time you enter the debugging mode. Without this step, you will NOT be able to successful store data in memory. What is the value of Z (in 4 bytes) after running the program? Write each byte value in hexadecimal in a box, i.e., do not write more than two hexadecimal digits in each box. You have to fill ALL boxes, even if its value is zero. Question 3 of 4 6.0 Points When the values of A, B, C, and D are 7, 1, 6, and 5, respectively, the value of Zin 4 bytes will be 0x Ox Ox Part 4 of 4 - Repeat Part 3 with the assumption that A, B, C, D, and Z are 8-bit values in memory. You can initialize them by using a DCB directive, instead of DCD. Modify your code accordingly to deal with these byte variables. Use the Keil simulator to write, assemble, and run the above program. What is the value of Z (1 byte) after running the program? Write this byte value in hexadecimal in the box. Do not write more than two hexadecimal digits in the box. Question 4 of 4 4.0 Points When the values of A, B, C, and D are 5, 9, 8, and 5, respectively, the value of Z (1 byte) will be 0x Part 3 of 4 Assume that A, B, C, D, and Z are 32-bit values in memory. You can initialize them by using a DCD directive. Remember, you can use a label to define the first location of a memory block. Note that you can put multiple values after the directive DCD or DCB, but you need to separate the values with commas. However, since each data item requires its own name, you have to use one directive per element, e.g., DCD value B DCD value DCD value D DCD value 2 DCD value Modify your program in part 2 to load (LDR) the values of r1 to r4 using these A, B, C, and D values, respectively. You also need to store (STR) the result in location Z. Use the Keil simulator to write, assemble, and run the above program To see the content of a memory segment, you need to open a memory window. To do this, while you are in the debugging mode, click on View, then select Memory Window and then Memory 1. Enter the starting address in the Address box in the memory window (which is 0) and hit return. In the memory window, we can see both the code and data. Note that you may need to resize the memory window, by dragging the edge of the memory window to display as many or as few bytes per line as you want. In Keil simulator, memory locations are read-only, by default. To change some of these locations to read-write, we have to perform an additional step. Click the Debug and then the Memory Map tabs. Enter a memory map range in the Map Range box and check the box Read, and Write, as needed, and finally click on the Map Range button. The format of the range is defined as 0x000,0x200, for example. This range is from memory location 0x000 to memory location 0x200. This step must be performed each time you enter the debugging mode. Without this step, you will NOT be able to successful store data in memory. What is the value of Z (in 4 bytes) after running the program? Write each byte value in hexadecimal in a box, i.e., do not write more than two hexadecimal digits in each box. You have to fill ALL boxes, even if its value is zero. Question 3 of 4 6.0 Points When the values of A, B, C, and D are 7, 1, 6, and 5, respectively, the value of Zin 4 bytes will be 0x Ox Ox Part 4 of 4 - Repeat Part 3 with the assumption that A, B, C, D, and Z are 8-bit values in memory. You can initialize them by using a DCB directive, instead of DCD. Modify your code accordingly to deal with these byte variables. Use the Keil simulator to write, assemble, and run the above program. What is the value of Z (1 byte) after running the program? Write this byte value in hexadecimal in the box. Do not write more than two hexadecimal digits in the box. Question 4 of 4 4.0 Points When the values of A, B, C, and D are 5, 9, 8, and 5, respectively, the value of Z (1 byte) will be 0x

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

Step: 3

blur-text-image

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

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

Students also viewed these Databases questions