Problem 3 (15 points)?Consider the high level code

147 views 10:36 am 0 Comments July 26, 2023

Problem 3 (15 points)?Consider the high level code:

int f, g, y //global 64-bit variables

int sum (int a, int b) { // at memory address X0+1000.

return (a +b)

}

int main (void) { // at memory address X0 + 800

f=2;
g=3;
y= sum (f, g);

return y;

}

Convert this code to LEGv8, making valid assumptions about registers and register use. Note that brackets and global variable declarations are not affecting the addresses of the instructions in memory.

Tags: , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *