Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

First, start Keil uVision 5 and open the project CS 2 3 8 . uvprojx . This project has two source files: 1 . init.s

First, start Keil uVision5 and open the project CS238.uvprojx . This project has two source files:
1. init.s - This file contains some initialization code and some utility functions to make I/O easy, which otherwise is extremely arduous in
assembly. It is recommended that you never modify this file, but trying to understand some or all of its code will be very instructive.
However, that's optional and, at this point you'll probably not understand much of it, but by the end of the semester, it'll all be a piece of
cake!
2. LMF120H5QR.inc - This file is included from within the init.s file. It contains code specific to a particular Texas Instrument
microcontroller that's based upon an ARM CPU. All our programs will be executed in an environment that simulates this microcontroller. You
should definitely never modify this file or something will very likely go wrong!!
Follow the steps-
1. Now, download the file HA4-main.s from the blackboard (Home Assignment Folder), and place it in the same CS238 folder that contains the
project.
2. Right-click on Source Code in the left-pane of Keil uVision5 and choose the option Add Existing Files to Group 'Source Code'....
3. In the pop-up window, set Files of type: to All Files (*.*), click on HA4-main.s, then the Add button, and finally the Close button.
4. Build the resulting project, and make sure you get 0 Error(s) and 0 Warning(s) in the Build Output window below.
5. Start execution of this project in the debugger, and select toolbar menu option View / Serial Windows / UART #1. This will bring up the
UART #1 console window for I/O.
6. Now click the Run button on uVision5(or the F5 function key) to run the program unobstructed. The UART #1 window will show prompts to ask
for your name and an integer value.
7. It will then display double of your integer value and stop. It will be useful if you try to understand all the existing code in HA4-main.s.
8. Terminate program execution by exiting the debugger.
Main Assignment:
Your assignment is to replace the portion in HA4-main.s that is within hyphened comments (i.e. everything between lines 40 and 64) by a
mainline program.
Your program will compute: 1+2+3+4+5+......................................................................................+n.
You could prompt the user for n and display the sum. You might want to use Gauss formula: n (n+1)/2.
Create your own sensible prompts and output messages.
An example execution of your program could be:
Please enter the number of terms in your series: 20
The sum of your series is 210.
Submit the code file in blackboard.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions

Question

Why do laws place limits on treasury stock purchases?

Answered: 1 week ago