Write the ARMv8 instructions for the following c code. Assume that the argumentsare stored in X0 onward in the order they are presented in the function. Assume that the result is returned in X0 as well. int add(int a, int b) { return a b; }

Respuesta :

Answer:

labelAdd:

add x0, x0, x1

mov pc, lr

Explanation:

  • Create a method called labelAdd.
  • Store the result in x0 by adding the value in the registers x0, x1.
  • Return to caller.