Question: 1 5 . The following MIPS assembly code is for a function with the signature int f ( char * a , char * b
The following MIPS assembly code is for a function with the signature
int fchar a char b;
:
: lb va
: lb va
: addiu a a
c: subu v v v: bnez v
: addiu a a
: bnez v
c: nop
: jr ra
: nop
The lb load byte instruction loads a single byte from memory at the address specified by the sum of the register and the immediate offset. For example, lb va loads the byte at the memory address stored in a into register v
a Explain briefly what this function does.
b Give one optimization that can be performed on the assembly code. Hints: Branch predictionbased prefetching
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
