Question

Create a MIPS program where you ask a user for 10 digit base 28 number and...

Create a MIPS program where you ask a user for 10 digit base 28 number and output a decimal in mips programming. It should also ignore any character that is not in the base 28 system and count its value as 0.

Example:

Input: 100000xza!

Output: 17210368

Input: xyzxyzxyzx

Output:0

Input: 1000000000

Output: 17210368

Output: 10578455953408

Input: 0000000000

Output:0

Homework Answers

Answer #1
.data
ms1_msg:.asciiz ""
.text
.globl main
main:

la $a0,ms1_msg    
li $v0,4
syscall

li $v0,5          #user enters number and it is stored in t0
syscall
move $t0,$v0


addi $t1,$zero,1  #t1=1
addi $t2,$zero,2  #t2=2
add $t5,$zero,1   #t5=1
add $t8,$zero,$zero 

add $t6,$zero,$t0  #t6=1

loop1:            #trying to find the counter for loop 2

addi $t5,$t5,1    
div $t0,$t2       
mflo $t4          
beq $t4,$t1,loop2 
sub $t0,$t0,$t0   
loop2:            #twith using the counter (t5) I define how many times loop should circle. 

    addi $t9,$t9,1    
    div $t6,$t2       
    mfhi $t7          
    mflo $t8          
    move $a0, $t7     
    li $v0, 1
    syscall
    beq $t9,$t5,exit
    sub $t6,$t6,$t6   
    add $t6,$t8,$t6 
    j loop2           

    exit:                                      
    li $v0,10       
    syscall
add $t0,$t4,$t0
j loop1           
Know the answer?
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
Similar Questions
4) Write a Java program using Conditions: Write a program where it will ask user to...
4) Write a Java program using Conditions: Write a program where it will ask user to enter a number and after that it will give you answer how many digits that number has. Steps: 1) Create Scanner object and prompt user to enter the number and declare variable integer for input 2) Use if else condition with && condition where you will specify the digits of numbers by writing yourself the digit number that should display: Example(num<100 && num>=1), and...
Create a program to ask the user for an integer number, positive only. If the number...
Create a program to ask the user for an integer number, positive only. If the number is between 0 and 255, printout the number in binary format to the screen. This will involve checking the bits, one by one, starting from the most significant place: 128. Use c++ 1. Modify the program to find the binary number, using a FOR loop, instead of the manual checking of each bit separately 2. What are the bitwise XOR and INVERSION operators? Find...
(1) Ask the user to input a character. You will draw your right triangle with this...
(1) Ask the user to input a character. You will draw your right triangle with this character. (2) Ask the user to input the number of rows (integer). This will also signify the number of characters at the base of the triangle. (3) Use a nested loop to draw the triangle. The first line will only have one character but will now need to output enough spaces such that the character is output at the end of the row instead...
Using MIPS, create a stack that takes user input until the user inputs 0, then output...
Using MIPS, create a stack that takes user input until the user inputs 0, then output the characters that were entered onto the stack. Make sure to use $sp. Example: Please enter a number. Press 0 to quit: 4 5 2 5 7 0 Your numbers were: 4 5 2 5 7
Ask user to input any 5-digit positive integer value. Calculate the sum of digits of that...
Ask user to input any 5-digit positive integer value. Calculate the sum of digits of that number. Assume that the number is positive, integer, 5-digit. Example: 29107 should calculate 2+9+1+0+7 and get 19 Hint: Use the % operator to extract a digit from a number. Use loop(s) Must be in Java
IN C++ PLEASE. Write a program where the user enters a number and you output an...
IN C++ PLEASE. Write a program where the user enters a number and you output an unfilled square of stars. (DO NOT PROMPT THE USER, just take in a number, The only console output should be the squares). For example the program would start with console input, The user would enters 3, you would output (note 3 is the lowest number your program will be tested with) *** * * *** or, The user enters 5, you would output *****...
Create a function in MIPS using MARS to determine whether a user input string is a...
Create a function in MIPS using MARS to determine whether a user input string is a palindrome or not. Assume that the function is not part of the same program that is calling it. This means it would not have access to your .data segment in the function, so you need to send and receive information from the function itself. The program should be as simple as possible while still using necessary procedures. Follow the instructions below carefully. Instructions: ●...
(8 marks) Write a program to ask user to input an integer and display the special...
Write a program to ask user to input an integer and display the special pattern accordingly. REQUIREMENTS The user input is always correct (input verification is not required). Your code must use loop statements (for, while or do-while). Your program should use only the following 3 output statements, one of EACH of the followings: System.out.print("-"); // print # System.out.print("+"); // print + System.out.println(); // print a newline Your code must work exactly like the following example (the text in bold...
In MIPS only!! make a program that multiplies a user input by 15. YOU CAN ONLY...
In MIPS only!! make a program that multiplies a user input by 15. YOU CAN ONLY USE ADDITION AND BITSHIFT OPERATIONS. Also very important, make sure its correct by using the mult and mflo operators (!More Important, explain to me how that's done!) . make sure to display user input and display the output. !!!please put comments on each line of what's happening!!!
Write a Java program named BinaryConversion that will convert base 2 numbers to base 10 numbers....
Write a Java program named BinaryConversion that will convert base 2 numbers to base 10 numbers. The data for this program will be entered from the keyboard using JOptionPane one 16-bit binary number at a time. Note that each base 2 number is actually read in as a String. The program should continue until a 16-bit base 2 number consisting of all 0’s is entered. Once the 16-bit number has been entered your program should make sure that the input...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT