CPR E 281x/282x - Lab 11b

 

Mixed C & Assembly Programming

 

1. Objectives

 

In this lab you will write a C & assembly program in PowerPC.

 

1.1 Reference Files for Lab

 

Lab Evaluation Form

 

 

2. Prelab

 

Before you come to lab it would be good to understand how to setup, declare, and use structures.  Also, it would be good to understand the EABI guidelines, e.g. how to pass parameters in mixed coding.  You can find information on all of these topics in the following documents:

 

PowerPC Manual

PowerPC Quick Reference

EABI Guidelines

 

 

3. Mixed C & Assembly Program

 

Write a program that will add two 64-bit numbers and display the resulting number on the QTerminal.  You will need to use a struct in C to represent a 64-bit number, (upper and lower halves).  You will need to write an assembly function to perform the addition.  To test your program, add the numbers 0x2031425364758698 and 0xF0F0F0F0F0F0F0F0.

 

Hints:

 

 

This will allow the assembly function to be called just as you would a regular c function (you will not use JumpAsm).