I am continuing my practice with MIPS assembly and machine code. I am doing a problem that assumes the following:
• variables a-j are assigned temporary registers $0-$8.
• the base address of arrays A and D are in $9 and $10.
• if need register to store an intermediate result, use remaining temporary or saved registers or register $at.
$0 - a $1 - b
$2 - c $3 - d
$4 - e $5 - f
$6 - g
These are the problems:
a) f = a - 20 + b + c - d;
b) D[i] = A[j] << 6;
c) f = g - A[D[5]]
This is my attempt:
a) addi $0, $0, 101100
add $5, $1, $2
add $5, $5, $0
sub $5, $5, $3
As for b) and c), I am not too sure how to do start it. I have attempted to find examples online but haven't been able to and the examples I'm going off of aren't that great.
If anyone can check and see if there is any issues or if you have any advice/help, Id appreciate it Thank you.