Homework 9 - ELEC 2220 Computer Systems Homework#9 Due Monday June 16 In this exercise you are to compile the following C program fragment into

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ELEC 2220 Computer Systems Homework #9 Due: Monday, June 16 In this exercise, you are to “compile” the following C program fragment into CPU12 assembly language and test it. Note that the calculation is the similar to that of homework #7, except that it is repeated multiple times, each time for corresponding elements of several arrays. char bob[5]; // array of 5 8-bit values char joe[5]; // array of 5 8-bit values char ann[5]; // array of 5 8-bit values char pat[5]; // array of 5 8-bit values char i; // 8-bit value for (i=0; i<5; i=i+1) { //execute loop 5 times, for i=0, 1, 2, 3, 4 bob[i] = (bob[i] + joe[i]) – (ann[i] + 8) + pat[i]; //perform calculation on i th array elements } Suggestions: 1. In RAM, define four 5-byte arrays: bob, joe, ann, pat, and one byte for variable i. 2. Define the following initial (decimal) values for the arrays (use “dc.b”). The initial value of i should be undefined (use “ds.b”). bob = {1,2,-3,-4,5}
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/23/2011 for the course ELEC 2220 taught by Professor Staff during the Summer '08 term at Auburn University.

Ask a homework question - tutors are online