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.
(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 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 and test code in MIPS assembly language program to implement algorithms "The Non-Restoring Algorithm "of...
Write and test code in MIPS assembly language program to implement algorithms "The Non-Restoring Algorithm "of an 8-bit integer the user shoud insert the number then by the algo well find the square root
This application accepts user input from the console and then prints the reverse of the user...
This application accepts user input from the console and then prints the reverse of the user input to the console. The last string that this program should print is the reverse user input. JAVA
Write an ARM Assembly program that obtains integer input from the keyboard. please write comments so...
Write an ARM Assembly program that obtains integer input from the keyboard. please write comments so i can understand what its doing :)