Question

write a MIPS assembly program to get an integer input from the user and multiply it...

write a MIPS assembly program to get an integer input from the user and multiply it by 2 and print output to the console

Homework Answers

Answer #1
.data
        prompt: .asciiz "write the  number here: "
        msg: .asciiz "After multiplying with 2: "
        
.text
        #prompt for number
        li $v0 4
        la $a0,prompt
        syscall
        
        addi $s0 ,$zero,2
        
        #read input
        li $v0,5
        syscall
        
        #move result to $t0
        move $t1,$v0
        
        mul $t0,$s0,$t1
        
        li $v0,4
        la $a0,msg
        syscall
        
        #printing number
        
        li $v0,1
        move $a0,$t0
        syscall
        
        

NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.

I AM HERE TO HELP YOUIF YOU LIKE MY ANSWER PLEASE RATE AND HELP ME IT IS VERY IMP FOR ME

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
Write a program in MIPS ASSEMBLY LANGUAGE.. Take no of students as input from the user,...
Write a program in MIPS ASSEMBLY LANGUAGE.. Take no of students as input from the user, then take marks of 5 subjects for each student from the user. Then find Minimun, Maximum and Median of all the subjects. and comment each line in code also make flow chart
(MIPS Assembly language) Ask user for two decimal numbers and save to memory (not registers). Multiply...
(MIPS Assembly language) Ask user for two decimal numbers and save to memory (not registers). Multiply these two numbers using adding and shifting only, not the "mul" instruction and print the product to the user as both a base-10 and base-32 (again, no using div/mul/rem). Save the output to a txt file. The program should run 5 times, with no user input needed to continue the program.    
Write a mips assembly language program that asks the user to enter and integer number and...
Write a mips assembly language program that asks the user to enter and integer number and read it. Then ask him to enter a bit position (between 0 and 31) and display the value of that bit.
Write a MIPS assembly program that asks the user first for a string, then for a...
Write a MIPS assembly program that asks the user first for a string, then for a character. The program should search the string for the character and print out the number of times the character appears in the string. Restrictions can be used, just be sure to list them. You must allocate space in the .data segment of your program for the user string.
(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...
Assembly Programming in MIPS Write a program in MIPS assembler that performs the following computations: Prompts...
Assembly Programming in MIPS Write a program in MIPS assembler that performs the following computations: Prompts the user to enter two integers and stores the smaller one in the first data memory word (with the lowest address) and the larger one in the second data memory word. Then divides the larger word by the smaller one in integer and stores the integer quotient in the third data memory word and the remainder in the fourth data memory word. Finally, it...
Write a MIPS assembly language procedure that simulates/implements the multiplication of two unsigned integers. The procedure...
Write a MIPS assembly language procedure that simulates/implements the multiplication of two unsigned integers. The procedure receives the mulitiplicand and the multiplier and returns the product. IT CANNOT USE A MULTIPLY INSTRUCTION! Write a MIPS assembly language program that demonstrates your multiplication procedure. Your program should ask the user for two integers to multiply. You can assume that the input integers are positive. Adhere to the procedure call convention.
 Write a program to find the prime numbers - Ask user to input the integer...
 Write a program to find the prime numbers - Ask user to input the integer number - test the number whether it is a prime number or not - Then, print “true” or “false” depending on whether the number is prime or isn’t. - Hint: number is prime when is has exactly 2 factors: one and itself. By this definition, number 1 is a special case and is NOT a prime. - Use idea of user input, cumulative sum,...
Write a MIPS Assembly Language program to request a name and reflect it back to the...
Write a MIPS Assembly Language program to request a name and reflect it back to the user. The request must be "Please enter your full name:" And it should be output following "The name you entered was: '
Write a MIPS Assembly program that computes the sum of all the odd numbers from 1...
Write a MIPS Assembly program that computes the sum of all the odd numbers from 1 ..99 and print out the answer Please make sure the program runs in QTSpim and prints the results. Also explain, thanks.