logo

Three Operands Addition

   

Added on  2019-09-21

3 Pages597 Words172 Views
 | 
 | 
 | 
1.Answer a.Code for Three Operands add $t0, $s1, $s2 add $s0, $t0, $s3b.Code for Two Operandsadd $s0, $s1 add $s0, $s2add $s0, $s3Here s0 is A , s1 is B , s2 is C and s3 is D in first line s0 will get whatever is s1 , in second line s0 will be added with s2 and in last line s0 ( which have addition of s0+s1) will be added with s3 , so you will get all the added values of s1 , s2 and s3 in s0.Difference between 3-Operand Arithmetic instruction, is 2 operands will take extra time to calculate, and it is executing add instruction three times, however in 3 operands have to executeadd two times only.2.Answeri)$T0 = 1ii)Sorting of Arrays 3.Answer 4.Answer.text.globlmainmain:lw $s1, B # Load the word stored in label Baddiu $s0, $s1, -201 # here S0 is A and s1 is B.dataB:.word 210
Three Operands Addition_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents