Answered step by step
Verified Expert Solution
Link Copied!

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
1
0
0
0
Enter the interest rate
(
like
5
.
0
)
5
.
0
Enter the number of years
1
0
Year:
1
: $
1
0
5
0
.
0
0
Year:
2
: $
1
1
0
2
.
5
0
Year:
3
$
1
1
5
7
.
6
3
Year:
4
: $
1
2
1
5
.
5
1
Year:
5
: $
1
2
7
6
.
2
8
Year:
6
: $
1
3
4
0
.
1
0
Year:
7
: $
1
4
0
7
.
1
0
Year:
8
: $
1
4
7
7
.
4
6
Year:
9
: $
1
5
5
1
.
3
3
Year:
1
0
: $
1
6
2
8
.
8
9
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",
0
promptRate BYTE "Enter the interest rate
(
like
5
.
0
)
"
,
0
promptYears BYTE "Enter the number of years",
0
balance REAL
4
0
.
0
rate REAL
4
0
.
0
term DWORD
0
.
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,
0
main ENDP
END main
INCLUDE asmLib.inc
.
data
outputYears BYTE "Year:
"
,
0
outCol BYTE
"
:
"
,
0
dollarSign BYTE
"
$
"
,
0
balance DWORD
0
.
0
rate REAL
4
0
.
0
term DWORD
0
.
code
yearlyBalance PROC
mov ecx,
[
esp
+
4
]
push
1
0
0
fild dword ptr
[
esp
]
pop ebx
fld dword ptr
[
esp
+
8
]
fdiv ST
(
0
)
,
ST
(
1
)
fstp ST
(
1
)
push
1
fild dword ptr
[
esp
]
pop ebx
fadd ST
(
0
)
,
ST
(
1
)
fstp ST
(
1
)
fild dword ptr
[
esp
+
1
2
]
mov ebx,
1
l
1
:
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
(
0
)
,
st
(
1
)
call writeFloat
endl
inc ebx
jmp l
1
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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

1st Edition

1597496251, 978-1597496254

More Books

Students also viewed these Databases questions