Calculate your grades based on the number of points you get

Assignment Help Assembly Language
Reference no: EM13847950

Assignment 1: - Conditional Processing

I have a small program that calculates your grades based on the number of points you accumulate over the entire semester. Let's create that program in this lab assignment.

If you look in the syllabus, this class grades are based on the number of points as follows:

Create a program that will ask the user how many students are in the class. There should be no more than 30 students. Verify that, indeed, the user entered up to 30 students. If he did, go further. If not, display a message that says that only 30 students are allowed in the class and jump back to the question of how any students.

Create a table that will display a header "Student ID", "Points", "Grade" as in the example below. Assign a 5 digit Student ID, starting with 00001. Going through each student id, one by one, use the random procedure to generate a random number of points from 300 to 1000. (We assume that a student will get at least 300 points in a semester). For each student, call a procedure CalculateGrades that will take the number of points and output the corresponding letter.

CalculateGrades Procedure

CalculateGrades uses the EAX register to get the number of points, and outputs the character in AL. Create a procedure header made with comments, that has 3 lines: First line a short description, second line RECEIVES:, third line RETURNS: where you write the registers used.

Note: You have an example of such a position header in your textbook, page 229, SetCursorPosition Example.

RandomRange PROC

Generates an unsigned pseudo-random 32-bit integer in the range of 0 through (n-1).

Call args: EAX = n, the range

Return arg: EAX = random (0 to n-1)

Example: Get a random number from 1 to 100  .data ranNum DWORD ?

.code

mov eax,100 ;get random 0 to 99

callRandomRange ;

inceax ;make range 1 to 100

movranNum,eax ;save random number

To generate a 32-bit random number, use the Random32 Procedure:

Random32 PROC

Generates an unsigned pseudo-random 32-bit integer in the range of 0 through FFFFFFFFh.

Call args: None

Return arg: EAX = random (0 to FFFFFFFFh)

Example:

.data ranNum DWORD ?

.code

call Random32

movranNum,eax ;save

Randomize PROC

Re-seeds the random number generator with the current time in hundredths of seconds.

Call args: None

Return arg: None

Example:

call Randomize ;re-seed generator

Requirements

• Make sure you use the stack this time. You should save all the registers you use before using them inside a procedure.

• Do not use conditional directives.

• Your random numbers should not be below 300, and should be able to reach 1000.

• Do not allow more than 30 students to be listed.

• The leading zeros have to be 4 for single digit numbers and 3 for double digit numbers to be consistent with a 5 digit ID.

• Don't forget to Randomize at the beginning of the program! Otherwise, every time you run the program you will have the same generated numbers.

Assignment 2:

Create a project. Take a look at the code ArryScan.asm shown in your textbook Section 6.3.4. Using ArrayScan.asm as an example, write the following project:

Ask the user to input the number of elements of a character array (less than 50 elements). Ask the user to enter a character that he wants to search in the array. Then ask him to input the characters one by one to fill the array. For this use indirect addressing.

Then your program has to search for the desired character in your array. Again, use indirect addressing. If the character is found, display the following message:

"Found the character x at position y in the array." Careful with the position count. The array starts from zero. ts from zero.

Of course, replace x and y with the corresponding character/number.

If it is not found display:

"The character was not found."

Here is an example:

and

Read the text and make sure you understand the code. Write a comment for each line of code you add to the project.

Verify it builds and runs, archive it and upload it in the Student Submissions area.

Reference no: EM13847950

Questions Cloud

Television program that contains a social inequality : A television program that contains a social inequality or social class theme (e.g. racism, sexism, social class categories)?
Investment in the new marketing campaign : For each of the above figures of merit, explain whether the firm should accept or reject the project. Given the results of your analysis, should Watson Corporation make the investment in the new marketing campaign? Why or why not?
How does petco compete with petsmart : How does Petco compete with PetSmart and other pet food stores, and how does the company's competitive strategy relate to its internal analysis?
Implement a modified version of the card game war : Implement a modified version of the card game WAR
Calculate your grades based on the number of points you get : Create a program that calculates your grades based on the number of points you accumulate over the entire semester
Project risk requirement : The management of risk is proving to be one of the most difficult tasks for the project management profession. How can risk be managed effectively and who should be responsible for this task?
How do law and ethics intertwine : How do law and ethics intertwine? Describe and distinguish among valid, void, voidable, and unenforceable contracts
Create a footer with the sheet name code in the center : Create a footer with the sheet name code in the center
What marketing strategy does mattel use globally : Give two examples from the case that the global market is important to Mattel's growth and describe briefly. What marketing strategy does Mattel use globally? Describe by giving an example from the case.

Reviews

Write a Review

Assembly Language Questions & Answers

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Secant method to try to find a root

Create a function that will use the Secant method to try to find a root. (Hint modify the posted version of False Position.) Because this method may diverge, you should limit the number of time the loop repeats.

  Write an arm assembly program that prints all the integers

Write an ARM assembly program that prints all the integers greater than 0 and less than 1000 that not divisible by 5. You must submit only a single file named "proj1.s" that is capable of running under ARMSim.

  Write an assembly program in mips that get the array size

Write an assembly program in mips that get the array size from the keyboard, then reads a list of integers from the keyboard and writes the sorted list in ascending order to the console screen.

  Nonrecursive factorialwrite a nonrecursive version of the

nonrecursive factorialwrite a nonrecursive version of the factorial procedure that uses a loop. a wdeonote for this

  Use maries isa program a stack structure for unsigned

use maries isa program a stack structure for unsigned integers.stackyou should write three subroutines for the stack

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write a program sequence that places the value in address

write a program sequence that places the value in address 1000 into accumulator a and places the value in address 1001

  Program in assebly language to solve first degree equations

Create the program on Assebly language which can solve First Degree Equations in form of Ax + B = 0. Coefficients of equation must be entered from keyboard.

  Requirementsthis project requires you to program a

requirementsthis project requires you to program a maze-type game using assembly language. it is not acceptable to use

  Assignment related to arm assembly

The 8-Segment display and LEDs will show status of the safe: U: indicates safe is unlocked, L: indicates safe is locked, P: indicates safe is programming a code, C: indicates safe is confirming a new code

  Create a procedure named validatepin that receives a pointer

Create a procedure named ValidatePIN that receives a pointer to an array of bytes containing a 5-digit PIN from your main proc. You are required to use the four byte arrays samplePin_1, samplePin_2,samplePin_3 and samplePin_4 declared below.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd