Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the windows32 framework, write a complete 80x86 assembly language program that prompts for inputs three grades with separate dialog boxes, and calculates the sum

Using the windows32 framework, write a complete 80x86 assembly language program that prompts for inputs three grades with separate dialog boxes, and calculates the sum and the average (sum/3) of the grades. Display the sum and average on two lines of a message box, each line with an appropriate label. Hint: Printing two lines in the same message box is the tricky part. It is the only challenging part in this question. Try to find a method exploiting CR and LF. Think about how you can have multiple identifiers identifying sections of the same string. That way you can have two 11 dup(0)s in the same string. I WAS DOING ABOVE PROBELM AND I HAVE THIS CODE BELOW WHAT I'M GETTING EROOR HOW HOW DO I DO IN ORDER TO PROGRAM TO RUN. PLEASE WRITE CORRECT CODE THAT CORRECTLY DISPLAY OUTPUT image text in transcribed

.586 .MODEL FLAT INCLUDE io.h ; header file for input/output .STACK 4096 .DATA number1 DWORD ? number2 DWORD ? number3 DWORD ? sumcount DWORD 3 ; we only need to divide the sum by 3 prompt1 BYTE "Enter grade 1:", 0 prompt2 BYTE "Enter grade 2:", 0 prompt3 BYTE "Enter grade 3:", 0 resultLbl BYTE "Sum:", 0 resultAvg BYTE "Average:", 0 sum BYTE 11 DUP (?), 0 avg BYTE 11 DUP (?), 0 string BYTE 40 DUP (?) .CODE _MainProc PROC input prompt1, string, 40 ; read first number as ASCII characters atod string ; convert to integer mov number1, eax ; store in memory input prompt2, string, 40 ; read second number as ASCII characters atod string ; convert to integer mov number2, eax ; store in memory input prompt3, string, 40 ; read third number as ASCII characters atod string ; convert to integer mov number3, eax ; store in memory mov eax, number1 ; move first number to EAX add eax, number2 ; add second number to EAX add eax, number3 ; add third number to EAX mov ecx, eax ; copy EAX's value into ECX mov ebx, sumcount ; put 3 in EBX idiv ebx ; divide the sum by 3 dtoa sum, eax ; convert to ASCII characters dtoa avg, ecx ; convert to ASCII characters output resultLbl, sum ; output label and sum output resultLbl, avg ; output label and sum mov eax, 0 ; exit with return code 0 ret _MainProc ENDP END ; end of source code

Information The sum is: 400 The average is: 40 OK

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

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

Students also viewed these Databases questions

Question

What is corporate meaning and what role does IMC play in it?

Answered: 1 week ago