Question: Use Visual Studios with the asm.lib (Assembly Language Library x86) Ask the user for the amount of numbers they would like to input. Construct a
Use Visual Studios with the asm.lib (Assembly Language Library x86)
Ask the user for the amount of numbers they would like to input. Construct a counted loop that will run the number of times the user specified. Inside the loop input numbers from the keyboard and sum all of the odd and even numbers. Use two DWORD variables to hold the odd and even sums. Create a DWORD variable called divisor and store 2 in it. This will be used to divide the number input.
(Starting Code)
Include asmlib.inc
.data
msg BYTE "How many numbers do you want to add",0
Prompt BYTE "Enter a number",0
outMsg BYTE "The sum of your numbers is",0
sum DWORD 0
.code
main PROC
mov edx, OFFSET msg
call writelLine
call readInt
add eax, sum
mov sum, eax
LOOP L1
mov edx, OFFSET outMsg
call writeString
call writeInt
exit
main ENDP
END main
The program should look like this:

How many number do you want to input? 5 Enter a number 1 Enter a number 2 Enter a number 3 Enter a number 4 Enter a number 5 The sum of the even numbers is 6 The sum of the odd numbers is 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
