Answered step by step
Verified Expert Solution
Link Copied!

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 floating-point 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 floating-point 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 ",0 promptRate BYTE "Enter the interest rate (like 5.0)",0 promptYears BYTE "Enter the number of years ",0 balance REAL8? rate REAL8? 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: ",0 outCol BYTE ": ",0 dollarSign BYTE "$",0 divisor REAL8100.0.codeyearlyBalance PROC mov ecx, \[esp +4\] fdiv divisor fld1 fadd fld ST(1) mov ebx, 1 l1: 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(0), ST(1) call writeFloat endl inc ebx jmp l1 ex:ret yearlyBalance ENDP END

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. Have the group identify common themes.

Answered: 1 week ago

Question

1. Describe the types of power that effective leaders employ

Answered: 1 week ago