Question: 11. [8 points] Fill in the blanks in the assembly code on the right necessary to make it equivalent to the C++ code on the

 11. [8 points] Fill in the blanks in the assembly code

11. [8 points] Fill in the blanks in the assembly code on the right necessary to make it equivalent to the C++ code on the left and obey the calling convention. It may not be necessary to use all the blanks. Recall that: * the first argument is in RDI, the second argument is in RSI, the return value is in RAX RBX, RBP, and R12-R15 are caller-saved registers countSpaces: mov RBX, RDI// array in RBX mov R8, 0 // i in R8 loop: mov_--- , add RBX R8 int countSpaces (char *array) I nt i - 0 while (isspace (array[i]) -0) call isspace return i; cmp RAX, 0 je endLoop add R8, 1 jmp loop // isspace ) ?- O0 endLoop: mov ,--- ret 11. [8 points] Fill in the blanks in the assembly code on the right necessary to make it equivalent to the C++ code on the left and obey the calling convention. It may not be necessary to use all the blanks. Recall that: * the first argument is in RDI, the second argument is in RSI, the return value is in RAX RBX, RBP, and R12-R15 are caller-saved registers countSpaces: mov RBX, RDI// array in RBX mov R8, 0 // i in R8 loop: mov_--- , add RBX R8 int countSpaces (char *array) I nt i - 0 while (isspace (array[i]) -0) call isspace return i; cmp RAX, 0 je endLoop add R8, 1 jmp loop // isspace ) ?- O0 endLoop: mov ,--- ret

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!