{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw5_A09

# hw5_A09 - ECE2801 Homework#5 – Introduction to Assembly...

This preview shows pages 1–2. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECE2801 Homework #5 – Introduction to Assembly Language Programming (Due Thursday 10/8/09 At the BEGINNING of class) PLEASE (NEATLY) SHOW ALL WORK ! Comment all code well. Do not make the grader guess what you are doing! All code should be typed. References : Class Notes, MSP430 User's Guide Ch. 3 and IAR EW Assembly Reference Guide (all available on class website) 1. (25 pts) The programs below both perform exponential averaging, or “smoothing”, on the input data array X according to Y[n] = (1-alfa)*Y[n-1] + alfa*X[n] a) Create a C project in IAR Kickstart and add the code below to it. Create a LIST file (under the project's C options) and notice the length and complexity of the assembly code that results from this simple C program. Step through the code and note the values of Y[0] thru Y[7]. #include "msp430x44x.h" #include <stdlib.h> #include <math.h> void main() { unsigned int x[8] = {150,172,147,161,180,179,162,166}; unsigned int y[8]; char i, arr_sz = 8; float alfa = 0.25; WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer y[0] = x[0]; i = 1; while (i < arr_sz) { y[i] = (1-alfa)*y[i-1] + alfa*x[i]; i++; } while (1) // dead loop does nothing useful i = i; }...
View Full Document

{[ snackBarMessage ]}

### Page1 / 4

hw5_A09 - ECE2801 Homework#5 – Introduction to Assembly...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online