00:01
Hello student, this program uses 26 real mips instructions that is less than maximum of 28 instructions.
00:07
So, it works by first initializing the variable a, b and c, then it calculates x, y and store them to the memory location 0x20 and 0x24 respectively.
00:19
Next it shifts y right by the 16 bit.
00:23
The while loop begins by checking if the c is greater than or equal to 1665 if it is the loop ends.
00:29
Otherwise, the loop calculates y divided by c divided by 2 and add it to the c.
00:34
Then it shifts c left by the 8 bits and store it to the memory location 0x30 and the loop then jumps back to the beginning of itself.
00:43
The program ends by jumping to the end label.
00:46
So here c+ + instructions pseudocodes are given.
00:50
So i have to write their corresponding assembly codes mips assembly code.
00:56
So first here variable initialization.
01:00
So here or immediate with this mnemonics i have to store in a note i have to assign this value 0x8000 and in with the help of load immediate instruction i have to assign the a1 means b value to this one 0x00 a9 and after this in s note i have to save the c value which will be 1974.
01:31
So these are the register i have taken $a0 $a1 $s0.
01:37
So arithmetic computations now i have to do the multiplication.
01:41
So here i what i am doing i am multiplying a into a.
01:45
So my a is in a note.
01:47
So a note with a note will be multiplied with this and the value will be saved to the $s1.
01:56
So $s1 means x.
01:59
So here it will a note into a note.
02:05
So this will be the calculation.
02:07
After this sw store a word now store x to the memory location at the address of 0x20.
02:14
So my now this s1 will be saved at the memory location 0x20 and after this i have to do this calculation y equal to x into b.
02:25
This is my a this is b and this is c.
02:29
So here for x into b this is x.
02:32
So x into b x value is in s1 and b value is in $a1.
02:39
So both of these will be multiplied and the value y $s2 will carry the value of y and y is equal to x into x into b.
02:51
So $s2 will carry the value of y and y calculation is x into b according to our program it will be $s1 into $a1.
03:04
So $a1 or $s1.
03:08
Now i have to save this into the memory location 0x24...