Here are the fixes to be made:

  1. There are 32 registers (r0 through r31). The following line uses "r99", but likely intended to use r9 instead:
    movia r99,10000000 /* set starting point for delay counter */
  2. This line branches to a non-existent label, "amin". Branching to "main" was probably the intention:
    bge r6,r5,amin   /* test for end of array */
  3. Your program should now assemble without error. Execute the program and notice how the digits printed are all ones, while we expect them to be 1, 2, 3, and 4. This means that we are not traversing the array of digits: instead, we are stuck on the first element of the array. The error happens here:
    stwio r3,0(r4)     /* Write to the red LEDs /
    addi r2,r2,1       /* increment address */
    
    The comment on the first line above is not terminated by */, thus the assembler considers the whole second line as part of the comment of the first line. Fix this problem by properly terminating the comment then run the program to verify that it is working correctly. Hint: Use single-line comments to avoid this problem.