Question

In this assignment you will direct users to input two pieces of information. First a number...


In this assignment you will direct users to input two pieces of information. First a number they would like a multiplication table for and then second how long of a table they would like. You will then do some sanity checking on the values (as we don’t want a negative length table), and afterwards pass them to a function to print the table. Once you have printed the table, go back and see if they want to exit or have another table printed.

Requirements:
1. Name your file thlYourLastName.asm.
2. You will get your input from the user for which multiplication table they want and how many
numbers they want printed in that table.
3. You’ll want to prompt the user for the information so that they know what to enter where, so
setting up the different segments of the code as we have been doing is a must.
4. Make sure you check the values that are entered.
5. You must use a function for the printing of the table. You can decide what, if anything, needs to be done with the stack for this one.
6. Remember that we want to repeat execution until the user chooses to leave, so add in the logic for that.
7. Format the table in a readable manner so that you can tell what numbers are being multiplied
together to get what answer. Include ending the program correctly and proper prompts in good formatting.

Mips coding please
0 0
Add a comment Improve this question Transcribed image text
Answer #1

.data
prompt: .asciiz "\nPlease enter number : "
prompt1: .asciiz "\nPlease enter length of table "
prompt2: .asciiz "\nError!!! Number should be positive "
.text
li $v0,4
la $a0,prompt #it will print prompt
syscall
li $v0,5
syscall #ask user input
move $t1,$v0 #save a to t1
askAgain:
li $v0,4
la $a0,prompt1 #it will print prompt
syscall
li $v0,5
syscall #ask user input
move $t2,$v0 #save a to t1
bgtz $t2,rightValue
li $v0,4
la $a0,prompt2 #it will print prompt
syscall
j askAgain
rightValue:
jal printTable

li $v0,10
syscall #terminate execution

printTable:
li $t0,1
loop:
bgt $t0,$t2,exit #loop while index <= length

move $a0,$t1
li $v0,1
syscall

li $a0,'X'
li $v0,11
syscall

move $a0,$t0
li $v0,1
syscall

li $a0,'='
li $v0,11
syscall

mul $a0,$t0,$t1
li $v0,1
syscall

li $a0,'\n'
li $v0,11
syscall

add $t0,$t0,1 #index++
j loop
exit:

Add a comment
Know the answer?
Add Answer to:
In this assignment you will direct users to input two pieces of information. First a number...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • You must write a C program that prompts the user for two numbers (no command line...

    You must write a C program that prompts the user for two numbers (no command line input) and multiplies them together using “a la russe” multiplication. The program must display your banner logo as part of a prompt to the user. The valid range of values is 0 to 6000. You may assume that the user will always enter numerical decimal format values. Your program should check this numerical range (including checking for negative numbers) and reprompt the user for...

  • Assignment Input from the user 9, 64-bit, floating-point values as a 3x3, row-major, multi-dimensional array. This...

    Assignment Input from the user 9, 64-bit, floating-point values as a 3x3, row-major, multi-dimensional array. This will be the 3x3 matrix. Then, input 3, 64-bit, floating-point values. This will be a single-dimensional array and is the vector. Your program will simply ask the user to enter matrix values. Remember, there are 9 of these, but they need to be stored into a 3x3 multi-dimensional array (row-major). Then, your program will ask for the vector values, which will be stored into...

  • Programming Assignment #2 EE 2372 MAKE SURE TO FOLLOW INSTRUCTIONS CAREFULLY, IF YOU HAVE ANY DOUBTS...

    Programming Assignment #2 EE 2372 MAKE SURE TO FOLLOW INSTRUCTIONS CAREFULLY, IF YOU HAVE ANY DOUBTS PLEASE EMAIL ME! This programming assignment will just be a small extension to programming assignment 1. In the first assignment each of the functions could only take a predefined number of inputs. This time the objective is to be able to complete these functions with any amount of inputs. The user will pass arguments through the command line (this means you will have to...

  • Convert the following C fragment to equivalent MIPS assembly language Write mini calculator that take two...

    Convert the following C fragment to equivalent MIPS assembly language Write mini calculator that take two integer numbers as input and ask the user if he need to compute addition, subtraction, remainder, division, or multiplication then print the result. Hint: you can give each operation a special number. For example, the addition (1), subtraction (2), …. And so on. The output must be something like: Enter the first integer number: 5 Enter the second integer number: 3 Which operation? 1...

  • In this assignment, you will be creating a program that requires a secret code to “unlock.”...

    In this assignment, you will be creating a program that requires a secret code to “unlock.” The program should first welcome the user and ask the user to input his/her name. Then the program will greet the user using the entered name. In order to “crack the code,” the user must input three integer numbers which satisfy the following conditions: The first number must be the number 3. The second number can either be the number 1 or be between...

  • In this assignment you are going to handle some basic input operations including validation and manipulation,...

    In this assignment you are going to handle some basic input operations including validation and manipulation, and then some output operations to take some data and format it in a way that's presentable (i.e. readable to human eyes). Functions that you will need to use: getline(istream&, string&) This function allows you to get input for strings, including spaces. It reads characters up to a newline character (for user input, this would be when the "enter" key is pressed). The first...

  • The assignment In this assignment you will take the Matrix addition and subtraction code and modify...

    The assignment In this assignment you will take the Matrix addition and subtraction code and modify it to utilize the following 1. Looping user input with menus in an AskUserinput function a. User decides which operation to use (add, subtract) on MatrixA and MatrixB b. User decides what scalar to multiply MatrixC by c. User can complete more than one operation or cancel. Please select the matrix operation 1- Matrix Addition A+ B 2-Matrix Subtraction A-B 3Scalar Multiplication sC 4-Cancel...

  • Program in C++! Thank you in advance! Write a menu based program implementing the following functions: (1) Write a funct...

    Program in C++! Thank you in advance! Write a menu based program implementing the following functions: (1) Write a function that prompts the user for the name of a file to output as a text file that will hold a two dimensional array of the long double data type. Have the user specify the number of rows and the number of columns for the two dimensional array. Have the user enter the values for each row and column element in...

  • Assignment Overview This assignment will give you more experience on the use of strings and iterations....

    Assignment Overview This assignment will give you more experience on the use of strings and iterations. The goal of this project is to use Google’s currency converter API to convert currencies in Python and display the result to user by processing the returned results. Assignment Background The acronym API stands for “Application Programming Interface”. It is usually a series of functions, methods or classes that supports the interaction of the programmer (the application developer, i.e., you) with some particular program....

  • In this assignment we are asking the user to enter two number values, the starting and...

    In this assignment we are asking the user to enter two number values, the starting and ending numbers for our application. Having these values, we then construct a loop that will increment by one (1) from the starting number through (and including) the ending number. Within this loop we will check the current value of our number to see if it is evenly divisible by 3, then by 5, and then by both 3 and 5. We will output all...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT