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
-
1. An object is thrown into the air, and t seconds later its height is h = f (t)=-4.9t +14.7 meters. Fill in the table below, and use your information to estimate the instantaneous velocity of the...
-
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...
-
An incumbent Firm is considering expanding its capacity. It can do so in one of two ways. It can purchase fungible, general-purpose equipment and machinery that can be resold at close to its original...
-
Show that the polar equation of the circle with center (c, a) and radius a is r2 + c2 - 2rc cos( - ) = a2.
-
Which journal entry records obtaining a bank loan of $15,000? DATE ACCOUNTS POST REF. DR. CR. a. Notes Payable 15,000 Accounts Receivable 15,000 b. Notes Payable Cash 15,000 15,000 C. Cash Notes...
-
The following stockholders equity accounts arranged alphabetically are in the ledger of Crivello Corporation at December 31, 2014. Common Stock ($3 stated value) ................. $2,400,000 Paid-in...
-
Gayane Corporation just issued a 20-year 12% semi-annual coupon bond. The bind is currently selling for $950 in the market. Suppose that the bond includes a call provision that allows the issuer to...
-
Kepler's second law states that as a planet moves around in its orbit, it sweeps out equal areas in equal times. Examine the following figure, which shows a planet (blue dot, labeled "E"), orbiting...
-
I need help finding different real life scenarios that use single threaded and multi threaded processes. -I need a scenario that uses only a single threaded process (besides a credit card...
-
During Year 14, Bird recognized a pre-tax operating income on Feeder $150,000. Additionally, Bird decided to sell the Feeder Division (Feeder) of its business. Feeder met the qualifications of a...
-
1) The connecting rod AB of a certain internal combustion engine weighs 1.2 lb with mass center at G and has a radius of gyration about G of 1.25 in. The piston and the wrist pin (pin A) together...
-
Briefly describe how you would analyse the data collected about workplace diversity. How would you use this data to help you meet the workplace objectives identified in Question 3.
-
Find the Inverse
-
Discuss the concept of symbiosis in microbial communities, exploring the intricate relationships between different microbial species and their host organisms in various environments .
-
Calculate the followings 2- ASSETS Cash Accounts receivable Inventory MARNI COMPANY Balance Sheet As of December 31 Net plant and equipment Total assets LIABILITIES AND STOCKHOLDERS' EQUITY Accounts...
-
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?...
-
What is automatic control?
-
A block diagram is represented by (a) circles (b) triangles (c) rectangles (d) parallelograms
-
What is a transducer? Explain the principle of operation of a transducer.
Study smarter with the SolutionInn App