Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 3 : String manipulation and memory addressing Objective The objective of this lab is to learn about the ARM instructions through programming an assembly

Lab 3: String manipulation and memory addressing
Objective
The objective of this lab is to learn about the ARM instructions through programming an assembly program using the materials covered in your textbook.
Background
By now, you are familiar with the ARM processor and its different kind of instructions (data movement, arithmetic, code control, etc.). In this lab, you will write a program that will put all this information to use. You are to write a program that will copy certain bytes of data in a string from one memory location to another memory location.
You will debug and/or navigate and explain to your TA the program using the information you learned in chapters three and four, and the tools provided by the Altera Monitor Program (AMP).
Implementation
You will write a program that copies data from one memory location to another using several methods.
(I) Write a "copy" program (35%)
You are to write a program that will copy a string from one memory location to another. Your program should eliminate spaces between the characters when copying the string. For instance, the string "I am a Cane" should be copied as "IamaCane". To do this, you need to create space for the original message, destination message, copy one character at a time as long as it is not a space character.
Requirements:
Your program should copy the data as strings
Your program should be less than 30 lines of code, comprehensively.
Compile and download your program to the board. In your project, click on the "Memory" tab and examine the content. What do you see? Explain the memory content to your TA and write down the answers in your lab report.
(II) Optimizing your program (35%)
Modify the code of your program so that it uses fewer instructions, compared to (I). Hint: You may need to consider instructions that handle multiple data transfer, such as multiple load and multiple store, or branching to different subroutines based on the result of a single comparison instruction
For instance, CMP, R1, #0
bne subR1
b subR2
Requirements:
Must use subroutines
Lab 3: String manipulation and memory addressing
How many instructions are you able to save, if any? Demonstrate the new program to your TA and write the new approach in your lab report.
Note: if you already used this approach for part (I), try a different approach (e.g., a different addressing mode). Part I and II of this lab cannot be the same.
(III) Expanding your program (20%)
Modify the code so that the program either copies the string forward, or backward. For instance, backwards mean "IamaCane" becomes "enaCamal". If the first character of the string is lower case letter, curly bracket, or tilde, then the program should copy the string backwards, otherwise the program should copy the string forwards.
Part III of this lab does not need to be optimized. You may use as many instructions or registers as you need to get the program executing.
Requirements:
Must use subroutines.
Demonstrate your program to your TA and describe your implementation in the lab report.
IV Lab Report (10%)
Complete the lab report and include the answers to the questions in sections (I) to (III) Follow the instructions in the lab report assignment to write your lab report.
image text in transcribed

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

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions