CS201 Lab: Run MIPS Assymbly Language with PIC32 Starter kit
Objective of this lab:
In this lab assignment, you are going to practice
implementing procedure calls in SPIM.
Preparation
Read lab lecture notes.
Lab Assignment
1. Practice by running the SUM program:
- Download the SUM package:
~ftp/pub/class/201/ftp/sum.zip
- Unzip it and save the files in a folder, say sum.
Here are the name of files:
- db_utils.a
- db_utils.h
- sum.S
- syscall.c
- syscall.h
- Click on the MPLAB IDE v8.76 icon on the desktop.
- Click on the Project menu and then select Project Wizard.
- Select a Device - PIC32MX360F512L, then click on Next.
- From Active Toolsuite, select MicrochipPIC32 C-Compiler Toolsuite, then click on Next.
- Create a New Project File, you have to specify a project filename.
Select a directory first, e.g. your sum folder, then type a filename. Then click on Next.
- Add the five existing files to your project. Click on Next.
- You will see the Summary window, click on Finish.
Your project is now successully created.
- Double click on sum.S, you will see it in an editor window.
It is the source code and it is a working program.
- From the Debugger menu, choose Select Tool, and select PIC32 Starter Kit.
- Click on Build All button or select Build All from the Project menu.
You will be able to see "BUILD SUCCEEDED".
- Click on the run button or select run from the Debugger menu.
If you see "Do you want to erase and re-program the memories before proceeding?" click on Yes.
- Click on Halt from the Debugger menu.
- Click on Reset from the Debugger menu.
- You can run your project again.
2. Programming:
Write a SPIM assembly language program num-vowel.s based on the
hardware implementation method in the lab notes and the above practice.
The program will do the following:
- Prompt the user to enter a string.
- The program will call the procedure vowelp
to check if a character entered in the string is a vowel or not.
- Count how many vowels and how many non-vowels are in the string.
- Print out the calculated results with appropriate message.
- Hint: A loop is needed.
You will run this program in the hardware and
show your testing result with input "Hello There!"
This page last modified:
Friday, 21-Aug-2020 15:27:44 CST
|
Accessed
times.
|
Copyright: Department of Computer Science, University of Regina.