Create a comment-based algorithm to solve the problems

Assignment Help Assembly Language
Reference no: EM132354470

Its masm kib Irvine lib32-bits not using 64. It must be written according to the details provided and more importantly it needs to match a beginner's level For all of the problems, a right-side column of comments must be included to explain the logic of the code.

You will ask the user for a String which will be a maximum of 40 characters long. You will then generate two random numbers between 0 and 15 inclusive. Save the numbers as the foreground and background colours.

You will also set to variables called row and col to 10 - which will be the row and col numbers where the text printing will start. Then, loop 300 times and inside the loop:

a) set the cursor at row and col;

b) set the text colour;

c) write the string;

d) advance the foreground colour and every time it reaches zero, decrement the background colour;

e) rotate the string one character to the left - the first character will become the last character;

f) advance the row value until it reaches 31 and then reset it back to 10 and increase the col value; and

g) delay the program 1/5 of a second. When the loop is done, set the cursor to row 35, and column 0.

Here is an algorithm defining this problem which will give you an example of how to create a comment-based algorithm to solve the problems.

More comments may be necessary and you can add them as required. ; collect a string from user (max 40 char) ; generate random foreground and background colour, store in vars ; clear the screen ; set row, column variables initially to 5 and 5 respectively ; loop 300 times, and for each iteration ; --> set cursor at (row, col) ; --> combine and set the colour for the text ; --> write the string ; --> advance foreground colour, if the foreground hits zero, decrease background colour (wraps around) ; --> rotate string to left, first char goes to the end ; --> advance cursor row value and if the row hits 25, reset the row to 5 and also increment the col value (col increases only when row hits 25) ; --> delay 1/20 second before the next iteration ;after the loop, set cursor to row 30, column zero.

2. Program with Small Parts Create a program which adds the following functionality, in the order described:

a) [10] Create an array that will hold 10 SDWORDS. Ask the user for a low and high number (verify the relationship of these value and swap if necessary) and then use low and high to generate random numbers to populate the array.

Finally, print the array as a comma separated list surrounded by square brackets (just like Arrays.toString() method).

This program must have separate procedures for populating the random numbers and printing the array - neither of which can reference the name of the array. Your program should work if the size of the array is simply changed in the .data section.

b) [20] Add a menu to the program from part which provides: 1 - Print the array; 2 - Total the array; 3 - Average value in array; 4 - Maximum value in the array; 5 - Minimum value in the array; and 0 - Exit.

The printing will now happen only if the user selects option 1, but the array will still be populated with random numbers as before. Options 2, 3, 4 and 5 must be separate methods - none of which can use the directive USES and none of which can use the name of the array.

c) [10] Add two more options: 6 - Multiply the array; 7 - Divide the array, and 8 - Mod the array.

For each, ask the user for the value of the multiplier or divisor as appropriate. The answer will be calculated for each element of the array and the result stored back in the array.

None of the array elements will be printed unless the user selects option 1 to print the array. Again, each of these options must have separate procedures - but all of them MUST use the USES directive to preserve registers as well as preserve flag values. Also, they must use indexed addressing (along with the actual array name).

d) Add four final options to the menu:

A - Arithmetic Shift the array values N to the right;

B - Shift the array value N to the left;

C - Rotate the array values N bits to the right; and

D - Rotate with Carry the array values N bits to the left.

For each, the user must be asked for the value of N. Use either indirect or Indexed addressing and preserve all appropriate registers and flags using whatever method you like. All four options must have separate procedures

When I read your comments, I should clearly see your algorithm - not a description of each assembly instruction. Also, there must be proper comments at the start of every procedure

Reference no: EM132354470

Questions Cloud

What is mackenzie effective annual rate : Assume that its trade credit terms are 1/10, net 40 and Mackenzie pays on day 35. Using a 365 day year
Discuss how harm reduction model and abstinence-base models : Discuss how the harm reduction model and the abstinence-based models may be appropriate for use with the behavioral addiction you have chosen.
Current price of the stock : A stock has one year, $130 strike price options that currently cost $6.13 for calls and $7.84 for puts. If the risk free rate is 5%
Benefits to using biotechnologies in developing countries : Where do most of the world's hungry live? What are some potential consequences and benefits to using biotechnologies in developing countries?
Create a comment-based algorithm to solve the problems : Program with Small Parts Create a program which adds the following functionality - ask the user for the value of the multiplier or divisor as appropriate
What will the minimum distribution she has to take : If her qualified account balance as of the end of last year was $500,000 what will the minimum distribution she has to take from her 401(k)
What are the negative impacts of supplier credit : What are the negative impacts of supplier credit on the new business start-up?
Principal paid in the first : Assume that a loan has a beginning balance of $500,000, a 30-year (360 month) term, an interest rate of 5.5%. The principal paid in the first month is:
How do cash flows generate value : How do cash flows generate value? What would be some examples of this?

Reviews

Write a Review

Assembly Language Questions & Answers

  How the expression is written in postfix notation

Describe the Floating Point Unit data stack and describe how the expression is written in postfix notation

  Program that ask the user to input a number between 0-10

Write a program that ask the user to input a number between 0-10 (n). Then your program finds the factorial of the number

  Prepare a program in mips assembly language

Prepare a program in MIPS assembly language that reads in a sequence of signed 32-bit integers (words) and return the maximum, the minimum, and the median value of the input sequence.

  Create a palindrome checker

CS12 Assembly Language Programming - write assembly code using integer arithmetic and Create a Makefile for this project make will build the project make clean

  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

  Recode all functions utilizing the stack frame method

Recode all functions utilizing the Stack Frame method - Test each function from main, print appropriate array after each test.

  Write down assembly program that calculates grade of student

Given a numeric score of a student, write down an assembly program that calculates the grade of the student as follows: if Score >= 90 then Grade = 1 else if Score >= 80 then Grade = 2 else Grade = 3 Program

  Write two-pass assembler for subset of mips instruction set

Write a two-pass assembler for a subset of the MIPS instruction set. It should be able to read an assembly file from the command line and write the object code to standard output.

  Write the following marie assembly language equivalent

Write the following MARIE assembly language equivalent of the following machine language instructions

  Write a program that finds the largest number

Write a program that finds the largest number among two numbers and store the result in any register.

  Design write and debug an assembly program

Design, write, and debug an MC8051 assembly program which does input port (P1) is red after each timer 0 overflow, value get complemented and output to port P2.

  Stack structure for unsigned integers

Write a program to push 10 items into your stack, and pop them out - Use MARIE's ISA program a stack structure for unsigned integers.

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