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

  Homework assignment on numerical representations

Create an assembly language function that displays the binary and hexadecimal representations of a 16 bit value (passed in as a parameter) on our LCD screen. Use the provided .c main file and assembly language subroutine example as a basis for you..

  Write a mips assembly language program to count

Write a MIPS assembly language program to count the number of 1s in a 32-bit word. Use assembly directives to initialize meaningful test data, make room for the result and use variable names within the code.

  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

  Write a complete well documented assembly language program

Write a complete well documented assembly language program (starts at $C000) that counts the number of 1s in each byte in a list.

  Motorola assembly language

The objective is to review the programmer's model, the Motorola assembly language, and the instruction execution cycle. To achieve these objectives, you will write a short program(s) satisfying the requirements below

  Carefully comment each line of the assembly program

The assembly language code segment below is to be inserted into the main.asm file that takes an input controlled by a potentionmeter, converts that input to a digital value, and displays that value on the LEDs according to the following

  Assembly-language program

Write an assembly-language program to add each element of list1 to the corresponding element of list2 and store it in the same location of list2. Use a loop.

  Problems does an assembler have to overcome

What problems does an assembler have to overcome in order to produce complete binary code with only one pass over the source code? How would code written for a one-pass assembler be different from code written for a two-pass assembler?

  Relative addressing mode is a special way

Relative addressing mode is a special way to specify operands. Which instructions are associated with the relative addressing mode? Why do you think it was called "relative" addressing mode? Hint: Use a search engine to find out about "portable code"

  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.

  Write an assembly language program that has two subroutines

write an assembly language program that has two subroutines one for encrypting alphabates of a string and second fo

  Pseudo-code in assembly language

Implement the following pseudo-code in assembly language (assume unsigned numbers). Declare Apple and Pear as byte sized variables.

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