Question: int Dif ( int a , int b ) { return b - a; } int Sum ( int m , int n ) {
int Difint a int b
return b a;
int Sumint m int n
int p Difn m;
int q Difm n; return p q;
int main
int x y;
z x y Sumx y;
return ;
Registers Variables
X x
X y
X z
Ex: If the values of X and X are initialized in the simulator as:
the result is stored in X:
Registers Data
X
X
the result is stored in X:
Registers Data
X
X
X
Given code:
ADDI X XZR # Assume Stack memory starts at Do not modify.
Procedure Main Do not modify
Main:
ADD X XZR X
ADD X XZR X
BL Sum
ADD X X X
ADD X X X
B End
Procedure Sum
Sum:
Type your code here.
Procedure Dif Do not modify
Dif:
SUB X X X
BR X
End:
The examples were given in the picture.
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
