Question: QUESTION 3 : The following programme is compiled on the same processor: #define var 1 last digit of your registration number #define var 2 digit

QUESTION 3:
The following programme is compiled on the same processor:
#define var1 last digit of your registration number
#define var2 digit of your registration number before the one used in var1
#define var3 digit of your registration number before the one used in var2
int x= var1;
int y= var2;
int z= var3;
int sum =0;
sum =x+y+z;
Compilation of the program gives the following assembly code:
addi $1,$0,0
addi $1,$0, var1
sw $1,0($0)
addi $1,$0, var2
sw $1,4($0)
addi $1,$0, var3
sw $1,8(R0)
addi $1,$0,0
sw $1,12($0)
Iw $2,0($0)
Iw $3,4($0)
Iw $4,8($0)
add $5,$2,$3
add $5,$5,$4
sw $5,12($0)
 QUESTION 3: The following programme is compiled on the same processor:

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 Programming Questions!