I am currently working on a program that calculates the prime numbers up to 200 using recursion in MIPS assembly using PCSPIM. So far, I have populated an array of numbers from 1-200 and a binary vector list that consists of all 1's successfully. The concept that I am struggling with is how to use a stack frame to help with the process.
Here is what I have for the stack frame:
subu $sp,$sp,32 # Set up the stack frame
sw $ra, 28($sp) # save $ra register to the stack
sw $fp, 24($sp) # save $fp register to the stack
addu $fp, $sp, 28 # set $fp register to the end of the stack
I just don't understand how this is going to help me find prime numbers. Any insight would be greatly appreciated!