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

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  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 assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  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.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

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