MIPS Assembly Question

Status
Not open for further replies.

strahd_von_zarovich

Advanced Member level 4
Joined
Sep 25, 2015
Messages
118
Helped
1
Reputation
2
Reaction score
3
Trophy points
1,298
Activity points
2,463
Hi everyone, i have a question below. I will solve the question if I know how to read values from memory. How can I know what are the memory addresses for INIT and MAX or A . I have a plenty of examples in my book but in all questions some information is given like “ A in $s0” or “base address of array is in $s0 so I can get values with load word function and offset : lw $t0, 8($s0)

Give the MIPS assembly code corresponding to the below for- statement. INIT and MAX values must be read from memory. A[ ] array is stored in memory address pointed to by value stored at A.
Sum=0;
for(i=INIT; i<MAX;i++) {
Sum= Sum + A; }
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…