Question: Please help me with the code, I keep getting an program timed out message: STUR XZR , [ X 2 0 , # 0 ]

Please help me with the code, I keep getting an "program timed out" message:
STUR XZR,[X20, #0]
ADDI X1, XZR, #1
STUR X1,[X20, #8]
ADDI X2, X20, #16
SUBI X3, X19, #2
loop:
CBZ X3, end
LDUR X4,[X2, #-16]
LDUR X5,[X2, #-8]
ADD X6, X4, X5
STUR X6,[X2, #0]
ADDI X2, X2, #8
SUBI X3, X3, #1
B loop
end: Write a program to populate an array with Fibonacci numbers. The Fibonacci sequence begins with 0 and then 1, each following number is
the sum of the previous two numbers. Ex: 0,1,1,2,3,5,8,13. Assume the size of the array is always at least 1. Use the '+' button under the
Registers display to store the size of an integer array in X19 and the address of the first element of the array in the memory in X20.
Ex: If X19 and X20 are initialized in the simulator as 5 and 5000, the data memory starting at address 5000 will contain:
Note: Use the '+' button under the Registers display to initialize X19 and X20. This zyLab platform supports the following LEGv8 instructions:
Arithmetic: ADD, ADDS, ADDI, ADDIS, MUL, SDIV, SUB, SUBS, SUBI, SUBIS
Data transfer: LDURB, LDUR, LDURH, LDURSW, MOVK, MOVZ, STURB, STUR, STURH, STURW
Logical: AND, ANDI, EOR, EORI, ORR, ORRI, LSL, LSR
Conditional branch: B.HS, B.LO, B.EQ,
B.GT,
B.GE, B.HI,
B.LT, B.LE,
B.LS, B.MI,
B.NE,
B.VC,B.VS,
B.PL, CBZ, CBNZ
Unconditional jump: B, BL, BR
This
platform supports the following LEGv8 instructions:
Arithmetic: ADD, ADDS, ADDI, ADDIS, MUL, SDIV, SUB, SUBS, SUBI, SUBIS
Data transfer: LDURB, LDUR, LDURH, LDURSW, MOVK, MOVZ, STURB, STUR, STURH, STURW
Logical: AND, ANDI, EOR, EORI, ORR, ORRI, LSL, LSR
Conditional branch: B.HS, B.LO, B.EQ,
B.GT,
B.GE, B.HI,
B.LT, B.LE,
B.LS, B.MI,
B.NE,
B.VC,B.VS,
B.PL, CBZ, CBNZ
Unconditional jump: B, BL, BR
Please help me with the code, I keep getting an

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!