Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am going to write multiplication the number of the device screen. Like the c++

ID: 3528857 • Letter: I

Question

I am going to write multiplication the number of the device screen. Like the c++ code above, but I really not sure what I did right or wrong. I need someone to help me. MIPS assembly language is kind of really new to me.`` cout<<"Height of the device screen: 960 "<<endl; cout<< "Width of the device screen: 640 "<<endl; int result; result=960*640; cout<<"The result of the Iphone 4S in pixel: "<<result; .data str1: .asciiz "Height of the device screen: 960 " str2: .asciiz "Width of the device screen: 640 " str3: .asciiz "The result of the Iphone 4S in pixel: " newline: .asciiz " " .text main: li $v0,4 #system call code for print string la $a0,str1 #address of str1 syscall #print str1 #get the first number from the user, put into $s0 li $v0,960 #system call for read input syscall #read integer into $v0 from console. move $s0,$v0 #move the number read into $s0 #read input string for str2 li $v0,4 #system call code for print string la $a0,str2 #address of str2 syscall #print str2 #get the second number from the user, put into $s1 li $v0,640 #system call for read input syscall #read integer into $v0 from console. move $s1,$v0 #move the number read into $s0 #do the calculation mul $s2,$s0,$s1 # s2 is the register to store $s0 and $s1 from the user input. #read print string for st3 li $v0,4 #system call code for print string la $a0,str3 #address of str3 syscall #print width*height li $v0,1 move $a0,$s2 #move the result of multiplication into $a0 to print syscall exist

Explanation / Answer

.data str1: .asciiz "Height of the device screen: 960 " str2: .asciiz "Width of the device screen: 640 " str3: .asciiz "The result of the Iphone 4S in pixel: " newline: .asciiz " " .text main: li $v0,4 #system call code for print string la $a0,str1 #address of str1 syscall #print str1 #get the first number from the user, put into $s0 li $v0,960 #system call for read input syscall #read integer into $v0 from console. move $s0,$v0 #move the number read into $s0 #read input string for str2 li $v0,4 #system call code for print string la $a0,str2 #address of str2 syscall #print str2 #get the second number from the user, put into $s1 li $v0,640 #system call for read input syscall #read integer into $v0 from console. move $s1,$v0 #move the number read into $s0 #do the calculation mul $s2,$s0,$s1 # s2 is the register to store $s0 and $s1 from the user input. #read print string for st3 li $v0,4 #system call code for print string la $a0,str3 #address of str3 syscall #print width*height li $v0,1 move $a0,$s2 #move the result of multiplication into $a0 to print syscall exist