Question: b) Convert the following C code to no more than 6 lines of equivalent LEGv8 assembly, assuming int64_t arr ()'s base address is held

b) Convert the following C code to no more than 6 lines



of equivalent LEGv8 assembly, assuming int64_t arr ()'s base address is held

in x8. Additionally use register X1 as a temporary register. Recall that

b) Convert the following C code to no more than 6 lines of equivalent LEGv8 assembly, assuming int64_t arr ()'s base address is held in x8. Additionally use register X1 as a temporary register. Recall that unlike LC2K, the LEGv8 ISA is byte addressed. (6 points) arr[a+8] = b; c = arr[arr[a+8]+10]; c) Convert the following C code to no more than 10 lines of LEGV8 assembly. Use ANDI to handle the mod (%) operator test. Additionally use register X1 as a temporary register. (10 points) HINT: 6094848 = 0x5D0000 a = 6094848; while (a>64) { if (d%8 != 0) d=d>>5; else d=d-35; a/=2; } Variable to register mappings int64_t cx4 int64_t a int64_t b - X2 int64_t e X6 - - X3 int64_t d X5 - int64_t f7 -

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!