Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I currently have some code written where I pass the balance and rate on the floating - point stack, but not the term. I am
I currently have some code written where I pass the balance and rate on the floatingpoint stack, but not the term. I am having a hard time understanding how to modify my code to pass balance, rate, and term on the floatingpoint stack. If anyone could explain what sort of modifications I could make to satisfy these requirements, I would be really appreciative! Thank you!INCLUDE asmLib.inc yearlyBalance PROTO.data promptBalance BYTE "Enter your balance promptRate BYTE "Enter the interest rate like promptYears BYTE "Enter the number of years balance REAL rate REAL term DWORD code main PROCmov edx, OFFSET promptBalance call writeLine call readFloat fstp balance mov edx, OFFSET promptRate call writeLine call readFloat fstp rate mov edx, OFFSET promptYears call writeLine call readInt mov term, eax fld balance fld rate push term call yearlyBalance exit main ENDP END mainINCLUDE asmLib.inc dataoutputYears BYTE "Year: outCol BYTE : dollarSign BYTE $ divisor REALcodeyearlyBalance PROC mov ecx, esp fdiv divisor fld fadd fld ST mov ebx, l: cmp ebx, ecx jg ex ; Loop bodymov edx, offset outputYears call writeString mov eax, ebx call writeInt mov edx, offset outCol call writeString mov edx, offset dollarSign call writeString fmul ST ST call writeFloat endl inc ebx jmp l ex:ret yearlyBalance ENDP END
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started