Write an ARM assembly language combination of a main program and a subroutine. The main program...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write an ARM assembly language combination of a main program and a subroutine. The main program should set up the stack pointer with the start of the stack at 0x20001000. The main program should call the subroutine at least once, with proper input arguments. You are going to write a subroutine to copying a string from one memory location to another, just like the function strcpy(str_from, str_to) in the C-language. The ARM assembly language subroutine should be named StrCpy. The subroutine StrCpy should take any two pointers from the main program, just like C-language subroutine, one pointer to copy data from and another pointer to copy data to. Each of the data pointer must be passed to the StrCpy in a separate register, the pointer to copy data from must be passed in RO and the pointer to copy data to must be passed in R1. The StrCpy is not expected to return any value. The label for string to copy from is "myStrToCopy" and the memory address for string to be copied to is 0x20001200. The subroutine can use other registers as needed, but the subroutine must preserve all the registers it uses, except RO and R1. myStrToCopy DCB "I want to copy this string!!!", 0x0 Remember rules of C-strings; the last character on the string has to be NULL, i.e. Ox0. Hint: Use can you loop construct to write your subroutine. Note: You must use STM and LDM instructions to get full credit, no PUSH and POP instructions allowed. Write an ARM assembly language combination of a main program and a subroutine. The main program should set up the stack pointer with the start of the stack at 0x20001000. The main program should call the subroutine at least once, with proper input arguments. You are going to write a subroutine to copying a string from one memory location to another, just like the function strcpy(str_from, str_to) in the C-language. The ARM assembly language subroutine should be named StrCpy. The subroutine StrCpy should take any two pointers from the main program, just like C-language subroutine, one pointer to copy data from and another pointer to copy data to. Each of the data pointer must be passed to the StrCpy in a separate register, the pointer to copy data from must be passed in RO and the pointer to copy data to must be passed in R1. The StrCpy is not expected to return any value. The label for string to copy from is "myStrToCopy" and the memory address for string to be copied to is 0x20001200. The subroutine can use other registers as needed, but the subroutine must preserve all the registers it uses, except RO and R1. myStrToCopy DCB "I want to copy this string!!!", 0x0 Remember rules of C-strings; the last character on the string has to be NULL, i.e. Ox0. Hint: Use can you loop construct to write your subroutine. Note: You must use STM and LDM instructions to get full credit, no PUSH and POP instructions allowed.
Expert Answer:
Answer rating: 100% (QA)
ARM Assembly AREA text CODE READONLY ENTRY main MOV R13 0x200010... View the full answer
Related Book For
Operating Systems Internals and Design Principles
ISBN: 978-0133805918
8th edition
Authors: William Stallings
Posted Date:
Students also viewed these programming questions
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Kiev Corp. was incorporated on January 2, 2020, but was unable to begin manufacturing activities until July 1, 2020, because new factory facilities were not completed until that date. The Land and...
-
Determine the coordinate direction angles of F, which is applied to the end A of the pipe assembly, so that the moment of F about O is zero. Given: F = 20 lb a = 8 in b = 6 in c = 6 in d = 10 in
-
A hardware store chain has just received a truckload of 5000 electric drills. Before accepting the shipment, the purchasing manager insists that 9 of the drills be randomly selected for testing. He...
-
Briefly explain how the following programs would affect the elasticity of demand for labor in the steel industry: a. An increased tariff on steel imports. b. A law making it illegal to lay off...
-
On January 1, 2014, Derek Company had Accounts Receivable $139,000, Notes Receivable $30,000, and Allowance for Doubtful Accounts $13,200. The note receivable is from Kaye Noonan Company. It is a...
-
Q3. If W and W are two independent Brownian motions and p is a constant between -1 and 1, then the process Xt = pWt + 1 pWt is continuous and has - marginal distributions N(0, t). Is this X a...
-
A nutrition plan app has a subscription that costs $10/month. The following chart gives average historical renewal rates for subscribers based on how many months they have been a subscriber. Month 1...
-
A company has in issue some 9 percent debentures, which are redeemable at par in three years time. Investors now require a yield of 10 percent. What will be the current ex-interest market value of...
-
What is taxation and what are the importance of taxation to economic development?
-
e te form h(x)= A rope or other non-rigid object suspended from its ends will form a catenary, or a function of the However, if the rope is weighted unevenly, the catenary may be deformed. Suppose in...
-
what is the best way for a young individual to do in order to begin investing and where and who should an individual go to to start investing in stocks? Explain
-
In a certain region of space, a uniform electric field has a magnitude of 4 . 3 0 x 1 0 4 N / C and points in the positive x direction. Find the magnitude of the force this field exerts on a charge...
-
They made the following expenditures during 2020: Category Amount Personal Expenditures Medical insurance premiums 10,000 Install a new deck on the house 30,000 Charitable contributions 3,000...
-
The following figures relate to inventory held at the year end. A C $ 20 30 $ 9 12 2$ 12 22 Cost Selling price Modification cost to enable sale Marketing costs Units held 2 7 200 150 300 Required...
-
Explain what is meant by vicarious liability and when it is available?
-
Both the search and the insertion time for a B-tree are a function of the height of the tree. We would like to develop a measure of the worst-case search or insertion time. Consider a B-tree of...
-
Consider a 4-drive, 200 GB-per-drive RAID array. What is the available data storage capacity for each of the RAID levels, 0, 1, 3, 4, 5, and 6?
-
What are the advantages and disadvantages of using a file integrity checking tool (e.g., tripwire). This is a program which notifies the administrator of any changes to files on a regular basis?...
-
Explain why the business objectives of owners and managers are likely to diverge. How might owners attempt to ensure that managers act in their interests and not in the managers own interests?
-
1. In what ways did the defence industries respond to the ending of the Cold War? 2. Using an Internet search, find out how the defence and security industries have responded to the threat of...
-
What is the Standard Industrial Classification (SIC)? In what ways might such a classification system be useful? Can you think of any limitations or problems such a system might have over time?
Study smarter with the SolutionInn App