I've created a PROC that will gather user input for a balance, interest rate & length of term (# of years) in a separate file. The interest rate is a floating point (fractional number - not an integer). I'm not sure if my balance needs to be converted to a floating point to multiply it by the rate.
I then PROTOtype that PROC in the separate file and call under main. I need to use this formula: interest = balance * rate / 100.0; to calculate the interest. I'm struggling to multiply the balance and rate. Please advise.
this code just multiplies the interest rate by itself in main.
fmul ST(0), ST(0)
call writeFloat
balances.asm PROC
yearlyBalance PROC
mov edx, OFFSET balanceNum
call writeLine
call readInt
fst bal
fld bal
mov edx, OFFSET interestRate
call writeLine
call readFloat
mov edx, OFFSET years
call writeLine
call readInt
endl
ret
yearlyBalance ENDP
main.asm
main PROC
call yearlyBalance
fmul ST(0), ST(0)
call writeFloat
endl
exit
main ENDP
END main