Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Simple Addition (2) Use the solution program from the preceding exercise as a starting point. Let this new program repeat the same steps three times,

Simple Addition (2) Use the solution program from the preceding exercise as a starting point. Let this new program repeat the same steps three times, using a loop. Clear the screen after each loop iteration.

your own work, please

INCLUDE Irvine32.inc

.DATA

prompt1 BYTE "Enter the first integer: ", 0 ;declare prompts prompt2 BYTE "Enter the second integer: ", 0 sum BYTE "The sum of the integers is: ", 0

.CODE

main PROC

mov dl, 20 ;set x and y values mov dh, 10

call Clrscr ;clear screen call Gotoxy ;place cursor mov edx, OFFSET prompt1 ;output prompt 1 call WriteString call ReadInt ;input integer 1

mov ebx, eax ;save integer 1 mov dl, 19 ;reset x and y mov dh, 11

call Gotoxy ;place cursor mov edx, OFFSET prompt2 ;output prompt 2 call WriteString call ReadInt ;intput integer 2

add eax, ebx ;add integers mov dl, 17 ;reset x and y mov dh, 12

call Gotoxy ;place cursor mov edx, OFFSET sum ;output sum statement and sum call WriteString call WriteInt call Crlf

exit ; exit to operating system

main ENDP END main

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_2

Step: 3

blur-text-image_3

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

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions