lab4_C09 (1) - ECE2801 Foundations of Embedded Systems Lab...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE2801: Foundations of Embedded Systems Lab Exercise #4 -- C Term 2009 Mixed Language Programming -- A 4 Function Calculator In this laboratory you will use MSP430 assembly language to implement the basic  math functions: add, subtract, multiply and divide for unsigned integers.  The  purpose of the assignment is to build and appreciation of the run-time cost of  different mathematical operators, and also to gain familiarity and skill with TI  MSP430 assembler (i.e. how can it possibly do all this with 27 instructions!).  Finally, you will marry the mathematical functions you've generated in assembly  with I/O routines written in C to produce a functioning calculator.  Assignment: You will have 2 weeks to complete this lab but you should start right away.  The  first task is to complete the assembly and mixed language demos using IAR  Kickstart. Demos:   These will not take a long time but should be helpful. Building an Assembly-only Project 1) Open IAR Kickstart and create a new empty project. Under the Project Options  tab, be sure to select the proper target chip, MSP430F449.  Also, on the first  page of the Project Options be sure to check the “Assembler Only Project” box. 2) Download main.s43 and shifts.s43 from the class website/Labs page and add  them to you project. These files demonstrate a framework structure of a 430  assembly program. Under the assembler options tab you may find it useful to  check the “Generate List file” box. Make the project.   3) Step through the code and see how it operates, how the procedures are called,  etc.  What happens on the line  done_it JMP done_it?  You can run either in the  simulator or with the FET debugger.  Building a Mixed Language C and Assembler Project 4) Open IAR Kickstart and create another new empty project. Under the Project  Options tab, elect the proper target chip, MSP430F449.  DO NOT  check the  “Assembler Only Project” box on the first page of the Project Options! 5) Download mixed_demo.c and shifts.s43 from the class website/Labs page and 
Image of page 1

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

View Full Document Right Arrow Icon
add them to you project. These files demonstrate how a C program can call an  assembler function. Under the assembler options tab you may find it useful to  check the “Generate List file” box. Make the project.  
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern