Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The output to my code is not outputting correctly. It needs to look like this. Enter your balance 1 0 0 0 Enter the interest
The output to my code is not outputting correctly. It needs to look like this. Enter your balance Enter the interest rate like Enter the number of years Year: : $ Year: : $ Year: $ Year: : $ Year: : $ Year: : $ Year: : $ Year: : $ Year: : $ Year: : $ Press any key to continue I need modifications to the very code I have here: 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 PROC mov edx, OFFSET promptBalance call writeLine call readInt fstp balance mov edx, OFFSET promptRate call writeLine call readFloat fstp rate mov edx, OFFSET promptYears call writeLine call readInt mov term, eax push balance push rate push term call yearlyBalance INVOKE ExitProcess, main ENDP END main INCLUDE asmLib.inc data outputYears BYTE "Year: outCol BYTE : dollarSign BYTE $ balance DWORD rate REAL term DWORD code yearlyBalance PROC mov ecx, esp push fild dword ptresp pop ebx fld dword ptresp fdiv ST ST fstp ST push fild dword ptr esp pop ebx fadd ST ST fstp ST fild dword ptr esp mov ebx, l: cmp ebx, ecx jg ex ; Loop body mov 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
The output to my code is not outputting correctly. It needs to look like this. Enter your balance
Enter the interest rate like
Enter the number of years
Year: : $
Year: : $
Year: $
Year: : $
Year: : $
Year: : $
Year: : $
Year: : $
Year: : $
Year: : $
Press any key to continue I need modifications to the very code I have here: 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 PROC
mov edx, OFFSET promptBalance
call writeLine
call readInt
fstp balance
mov edx, OFFSET promptRate
call writeLine
call readFloat
fstp rate
mov edx, OFFSET promptYears
call writeLine
call readInt
mov term, eax
push balance
push rate
push term
call yearlyBalance
INVOKE ExitProcess,
main ENDP
END main
INCLUDE asmLib.inc
data
outputYears BYTE "Year:
outCol BYTE :
dollarSign BYTE $
balance DWORD
rate REAL
term DWORD
code
yearlyBalance PROC
mov ecx, esp
push
fild dword ptresp
pop ebx
fld dword ptresp
fdiv ST ST
fstp ST
push
fild dword ptr esp
pop ebx
fadd ST ST
fstp ST
fild dword ptr esp
mov ebx,
l:
cmp ebx, ecx
jg ex
; Loop body
mov 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 with AI-Powered 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