im having some problems with understanding how to convert instructions to MIPs assembly. the problem is. Write the MIPS assembly for the following instructions. Assume variables a – j are assigned to temporary registers $0 – $8. Assume that the base address of arrays A and D are in $9 and $10. If you need a register to store an intermediate result, you can use any remaining temporary or saved registers or register $at (the assembler temporary register). Convert the assembly codes into machine code
D[i]=A[j]<<6
now , i have it set up like this
- 0$
- 1$ a
- 2$ b
- 3$ c
- 4$ d
- 5$ f
- 6$ g
- 7$ i
8$ j
- 9$ A
- 10$ B
im a confused , because in class , my teacher always started with the SLL (shift logical left) command for the 2 examples we did. my question is do we always do this? im not sure i understand what SLL actualy means/does , so i cant really see if it would benefit this problem. so far i have the firt instruction , this is assuming SLL is the first thing that happens. I thought maybe LW would come first. this is what i got for my answer
- SLL $11 , $8 , 6 2.Add $12, $9,$11
- lw $13,0($12)
- sll $14,$7,2
- add $15,$14,$10
- sw $13,0(15$)
$8-$15,$24-$25, not$0-$8. Please, make your question a bit clearer. - user35443