write a MIPS assembly program to get an integer input from the user and multiply it by 2 and print output to the console
.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
Get Answers For Free
Most questions answered within 1 hours.