For this project, you will write a MIPS assembly language program to calculate periodically compounding interest. Your program should prompt the user to enter the necessary parameters for the calculation and continue to loop until the user opts to quit. The equation for periodically compounding interest is b = p( 1 + r)r, where b is the balance after the end of C applications of interest, p is the principal (starting balance) and r is the interest rate. Since MIPS does not have a power function, you will need to build one by iteratively multiplying the sum C times. This computation would normally require the use of floating-point variables and operations. However, the necessary precision can also be obtained by representing the money in integer units of pennies and by making the interest rate in terms of percentage. Once the correct number has been calculated, the correct magnitude can be calculated by dividing by 100r to get the balance in pennies. From this point, the division and modulus operations can be used to convert the answer to its standard format. Your program should include appropriate comments indicating what the code should be doing and what registers are being used for. After displaying the results, your program should exit cleanly.

so, what have you done so far?

Steve i only have the algorithm but need help in using the proper commands and registers

To write a MIPS assembly language program to calculate periodically compounding interest, we can break down the problem into smaller steps and solve them step by step. Here is an outline of the program:

1. Define variables and prompts:
- Define variables to store the principal (p), interest rate (r), and number of compounding periods (C), each as an integer.
- Define a variable to store the balance (b), also as an integer.
- Define prompts to ask the user to enter the values of p, r, and C.

2. Enable the user to input values:
- Use syscall instruction to prompt the user to input p, r, and C.
- Store the input values in the appropriate variables.

3. Calculate the balance using iteration:
- Initialize a register to hold the iterative multiplication factor.
- Use a loop to repeat the multiplication C times, updating the multiplication factor each time.
- Inside the loop, multiply the multiplication factor by (1 + r) in each iteration.
- After the loop, multiply the multiplication factor by p to obtain the balance in pennies.

4. Calculate the correct magnitude:
- Divide the balance by 100r to get the balance in pennies.
- Store the result back in the balance variable.

5. Convert the balance to its standard format:
- Divide the balance by 100 to get the dollar part.
- Use the modulus operation to get the remaining cents part.

6. Display the results:
- Use syscall instruction to print the calculated balance in dollars and cents.

7. Exit the program cleanly.

Here is a sample MIPS assembly code combining these steps:

```
.data
p: .word 0
r: .word 0
C: .word 0
b: .word 0
prompt_p: .asciiz "Enter the principal (starting balance): "
prompt_r: .asciiz "Enter the interest rate (%): "
prompt_C: .asciiz "Enter the number of compounding periods: "
result_msg: .asciiz "The calculated balance is: $"

.text
.globl main

main:
# Step 1: Define variables and prompts

# Step 2: Enable the user to input values
li $v0, 4
la $a0, prompt_p
syscall
li $v0, 5
syscall
sw $v0, p

li $v0, 4
la $a0, prompt_r
syscall
li $v0, 5
syscall
sw $v0, r

li $v0, 4
la $a0, prompt_C
syscall
li $v0, 5
syscall
sw $v0, C

# Step 3: Calculate the balance using iteration

li $t0, 1 # Register to hold multiplication factor
lw $t1, p # Load principal value
lw $t2, r # Load interest rate value
lw $t3, C # Load number of compounding periods value

loop:
mul $t0, $t0, $t2 # Multiply the multiplication factor by (1 + r)
addi $t3, $t3, -1 # Decrement the counter C
bnez $t3, loop # Repeat loop if C is not zero

mul $t1, $t1, $t0 # Multiply the principal by the multiplication factor
sw $t1, b # Store the result in the balance variable

# Step 4: Calculate the correct magnitude
div $t1, $t1, $t2 # Divide the balance by 100r

# Step 5: Convert the balance to its standard format
div $t1, $t1, 100 # Divide the balance by 100 (for dollars)
mflo $t4 # Move the quotient to $t4 (dollars)
mfhi $t1 # Move the remainder to $t1 (cents)

# Step 6: Display the results
li $v0, 4
la $a0, result_msg
syscall

li $v0, 1
move $a0, $t4
syscall

li $v0, 4
la $a0, "."
syscall

li $v0, 1
move $a0, $t1
syscall

# Step 7: Exit the program cleanly
li $v0, 10
syscall
```

This code should prompt the user for the necessary parameters, calculate the balance based on the equation for periodically compounding interest, convert it to standard format, and display the result.