CSP25 Assignment 07 Question 1 (From Chapter 6) Create a

CSP25 Assignment 07
Question 1 (From Chapter 6)
Create a procedure named CalcGrade that receives an integer value  
between 0 and 100, and returns a single capital letter in the AL  
register. Preserve all other register values between calls to the  
procedure. The letter returned by the procedure should be according  
to the following ranges:

Score Range  Letter Grade
————————-
90 to 100        A
80 to  89        B
70 to  79        C
60 to  69        D
0 to  59        F

Write a test program that generates 10 random integers between 50 and 100,  
inclusive. Each time an integer is generated, pass it to the CalcGrade  
procedure.   

You display the integer generated by using the Irvine method WriteDec.
Also use WriteString method to display a message such as “The grade is : “
and then use WriteChar to display the grade calculated.

Here is an algorithm for your test program to help achive solution for this problem:
(Next page)

You still need to figure out how to get grade correctly in your CalcGrade procedure.

 
Algorithm for test program.

Set count to 10 (Can be in ECX)

Start of Loop
 set upper limit to 51
 Call RandomRange procedure
   [generate # result from 0 to 50 and it is in EAX]
 Add 50 to result above to get 50 to 100. Add to EAX
 Display this number (in EAX) using WriteDec
 Call CalcGrade procedure (and grade will be in AL)
 Setup string to be displayed ” ”
 Call WriteString
 Call WriteChar (to display grade in AL)
Repeat loop

Algorithm for CalcGrade procedure.

# score of 50 to 100 is in EAX

If EAX > 90
  Set al to ‘A’
Else if EAX > 80
  Set al to ‘B’  
Else if EAX > 70
  Set al to ‘C’  
Else if EAX > 60
  Set al to ‘D’  
Else
  Set al to ‘F’   

Make sure you have the following at the top of your Assembly code file. Fill it up accordingly
such as the name of the asm file will be Assignment07.asm
; Program Template (Assignment01.asm)
; Program Description: <fill this up>
; Author: <fill this up>
; Creation Date: <fill this up>
; Revisions:  <fill this up if necessary>

; Date:Modified : <fill this up if necessary>
Also make sure to document your Assembly code.

What to submit?
TWO files.
1. Copy your program and paste it to a text editor such as Notepad and save file as .txt file
then submit this text file.
2. A pdf file that has your code (copied or screenshot) and output of dumping of your
registers.

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

1. From your reading by Cheryl Hicks “Bright and Good-Looking

1. From your reading by Cheryl Hicks “Bright and Good-Looking Colored Girl: Black Women’s Sexuality and ‘Harmful Intimacy’ in Early-Twentieth Century New York”, how was the societal view of Black women’s sexuality different than the view of White women’s sexuality during this era?   2. From your reading by Davila,

A. Largest influence on gender roles in contemporary American society?

 A. Largest influence on gender roles in contemporary American society? 100 words each minimum. 1. Parents? 100 words minimum  2. Teachers?  100 words minimum   3. Media?  100 words minimum 4. Something else like work environment or friends?  100 minimum each.  Please use chapter 5 on the word document attached Be sure

Reflect on your preferred way you like to communicate with

 Reflect on your preferred way you like to communicate with others. Do you prefer the same method for professional and personal communication? Why, or why not? After you have identified your preferred method, reflect on how you feel you could improve your communication skills in both professional and personal settings.

In this discussion, you will be assigned two equations where

In this discussion, you will be assigned two equations where you will complete a variety of math work related to mathematical functions. Read the following instructions in order and view the MAT222 Week 5 Discussion Example  to complete this discussion. Please complete the following problems according to your assigned number.

Hello, I go by xxxx and my major is Psychology

 Hello, I go by xxxx and my major is Psychology with concentration in Mental Health. I recently moved to Ohio from Maine. Huge differences in the surroundings along with diversity in this small community. I grew up in a very tight religious organization that was very strict on your thoughts

Describe the importance of a universal standard measuring system (SI

 Describe the importance of a universal standard measuring system (SI units) in scientific work. Include at least two examples of real-life situations in which the use (or non-use) of SI units affected the outcome of the situation. In many countries, SI units are standard, but this is not true in

Hazard, Vulnerability, and Mitigation Processes Choose one of the following

Hazard, Vulnerability, and Mitigation Processes Choose one of the following disaster events. Identify 2 hazards, 2 vulnerabilities, and 2 mitigation efforts. Apply an all-hazards plan of action. Disaster Events:Explosion at a fertilizer plant next to a small rural town. Uncontrolled wildfire approaching an urban area.A volcanic eruption near a populated

I have employed you as a consultant and asked to

   I have employed you as a consultant and asked to write a report to the Trustees of the BBC on the success or failure of procurement of the Digital Media Initiative (DMI). The Digital Media Initiative (DMI) was a project launched by the BBC in 2008. It aimed to

Book Review The book title is: The Marrow Thieves. By:

Book Review The book title is: The Marrow Thieves. By: Cherie Dimaline. Just give me a one-to-two pages of your reflection about the book  Make sure you put the following information on your document: Name; Student ID No.; Class: Econ 120 Fall 2021. Use Font 12, Times New Roman, 1”

Explain why “Publishing” is Barnes&Noble’s additional

Your case talks about barnes& noble’s challenge. timeline from 2010 to 2015. All resources must match this timeline. 1. Who is Barnes&Noble? -you Look at the attachment for an Example. additionally, you should talk about struggling, Annual Report, brand image(summary, mission statement, product offerings, and a loyalty program (2 pages,

PART 1: Each one needs to 150-180 words: DQ1. Considering

PART 1: Each one needs to 150-180 words: DQ1. Considering a situation, in which you were involved, explain a time when negotiation efforts were effective. DQ 2: Considering a hypothetical situation, describe a scenario when negotiation efforts would be considered ineffective. DQ 3: What types of situations do you think

ANSWER THE QUESTIONS ATTACHED AND PROVIDE A PEER REVIEWED ARTICLE

  ANSWER THE QUESTIONS ATTACHED AND PROVIDE A PEER REVIEWED ARTICLE AS A REFERENCE USE ONLY THE ARTICLES FOR REFERENCE AS THEY ARE THE FOCUS OF THE QUESTION ANY ADDITIONAL REFERNCE CANT BE NO OLDER THAN 2017 NO LESS THAN 200 WORDS NO MORE THAN 300 SEPERATE THE TWO QUESTIONS

WEEK 2 ASSIGNMENT – CYBERSECURITY AGENCIES Week 2 Assignment

  WEEK 2 ASSIGNMENT – CYBERSECURITY AGENCIES Week 2 Assignment – Cybersecurity Agencies Use a Web search engine to search for local, state, and federal government agencies that deal with cybersecurity. You will select one agency to write about. A list of suggestions is provided below.Select from criminal justice organizations

HHS 265 Week 5 Discussion Questions Nursing Assignment Help

This paperwork of HHS 265 Week 5 Discussion Questions shows the Solutions to the following problems: DQ 1: How are budgeting systems used to weigh the efficiency and effectiveness of a health and human service agency? Why is this important?DQ 2: What are the most important issues for a human

Describe four proven data protection strategies a company can use

 Describe four proven data protection strategies a company can use to protect their data stored in the cloud. Use your textbook and quality external resources for your writing assignment. Remember to cite your sources. APA format is preferred. However, MLA or Chicago (Turabian) would be fine as well. The important

This week you will be making a final decision regarding

  This week you will be making a final decision regarding the instruments that you will use to assess your programs.  Provide the name of each instrument that you have chosen to use in your evaluation, along with full citation and reference, and address each of the following: What is

1- Describe the components and quality which is necessary for

1- Describe the components and quality which is necessary for the documents of software specification. 2- Define the blue print methodology. 3- What are the differences between verification and validation in software development, and the benefits of verification and validation in software development? 4- Explain the various types of models