Hi I am fairly new at programming, I am working on a final project for my assembly language class where I am calculating college savings, this is the formula I believe I will end up using, fv= pv(1+(r/n))^nt, but I am in desperate need of help in writing that in to code in regards to the base * power. I have seen codes for other simulators but my professor requires us to use PCSpim. If anyone has any tips I would truly appreciate it.

I'm not familiar with MIPS; I'm more of an Intel man myself, but in any case, you'd have to recersively multiply a number with the power, so now for some pseudo-ish code examples:

2^3

a = 2
b = 1
repeat 3 times: {b = b * a}

so for a^b:

repeat b-1 times: {a = a * b}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.