

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A lab exercise for cse4903 students, focusing on the powerpc architecture, its registers, and instruction set. Students will learn to code and debug programs using metrowerks codewarrior, and complete tasks such as implementing bubble sort algorithm, clearing an array, and depositing constants into an array using embedded instructions. Students are encouraged to optimize their code for performance and document their design, implementation, and results.
Typology: Lab Reports
1 / 2
This page cannot be seen from the preview
Don't miss anything!
In this lab you will start exploring the PowerPC architecture, its registers and instruction set. You will learn how to code and debug programs in Metrowerks Codewarrior, an integrated software development environment for many embedded, handheld, and desktop platforms. You will also get familiar with the laboratory report requirements.
In this exercise you will use PowerPC instructions to accomplish several basic tasks. Before you start to write your own program, you may want to get familiar with the tools. A sample project lab1.zip can be downloaded from the course website. Follow the instructions in the manual to compile and run the sample code first. Then, you can add your own code into the sample code to complete the following tasks.
void my_bubblesort(unsigned int *p, int n);
The function will sort the n unsigned integer stored in p in descending order.
void clear_array(unsigned int *p, int n) { asm {
} }
You can then call clear_array(BUF, 8) to set BUF to 0.
You are free to use any instructions to accomplish the above tasks, but awkward choices of instructions will result in point deduction. You should try your best to optimize the code for performance.
Document your design, implementation, and results carefully. You may consider these tasks as several steps in a big task. So you can have only one objectives section, in which you describe all the tasks you have done (instead of having several individual objectives sections).
Write a report adhering to the lab requirements. The report should include your design rationale (e.g. why you choose these instructions and how they achieve the goals) and results. Since you do not need many instructions to finish these tasks, you can include important sections of your code in the report.