Answered step by step
Verified Expert Solution
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 uVision and open the project CSuvprojx This project has two source files:
init.s This file contains some initialization code and some utility functions to make IO 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!
LMFHQRinc 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
Now, download the file HAmain.s from the blackboard Home Assignment Folder and place it in the same CS folder that contains the
project.
Rightclick on Source Code in the leftpane of Keil uVision and choose the option Add Existing Files to Group 'Source Code'....
In the popup window, set Files of type: to All Files click on HAmain.s then the Add button, and finally the Close button.
Build the resulting project, and make sure you get Errors and Warnings in the Build Output window below.
Start execution of this project in the debugger, and select toolbar menu option View Serial Windows UART # This will bring up the
UART # console window for IO
Now click the Run button on uVisionor the F function key to run the program unobstructed. The UART # window will show prompts to ask
for your name and an integer value.
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 HAmain.s
Terminate program execution by exiting the debugger.
Main Assignment:
Your assignment is to replace the portion in HAmain.s that is within hyphened comments ie everything between lines and by a
mainline program.
Your program will compute: n
You could prompt the user for n and display the sum. You might want to use Gauss formula: n n
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:
The sum of your series is
Submit the code file in blackboard.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started