QuestionQuestion

Write an x86 assembly language program that performs equivalently to the C++ source code file shown below.
Please note that commented out behavior must be implemented in x86 assembly language.
There is no standard, portable way to perform some of these actions in C++.#include <iostream>

void main()
{
// Use registers for these in your x86 assembly language program
// Only use the .data segment for string (character array) variables
int eax;
int esi;
int ecx;
int edi;

// Loop the following three times
for (ecx = 3; ecx > 0; --ecx)
{
// Clear the screen

// Move the cursor to row 10, column 10

std::cout << "Enter a signed integer value: ";
std::cin >> eax;
edi = eax;
// Move the cursor to row 11, column 10 std::cout << "Enter a second signed integer value: ";
std::cin >> eax;
esi = eax;

eax = edi + esi;
std::cout << "The sum is: " << eax << std::endl;

eax = edi - esi;
std::cout << "The difference is: " << eax << std::endl;

// Pause for two seconds
}

system("PAUSE");
}

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

INCLUDE Irvine32.inc

.data
msg1 BYTE "Enter a signed integer value: ", 0 ; first message
msg2 BYTE "Enter a second signed integer value:", 0 ; second message
msg3 BYTE "The sum is: ", 0 ; third message
msg4 BYTE "The difference is: ", 0 ; fourth message
.code
main PROC

; for (ecx = 3; ecx > 0; --ecx)
mov ecx, 3
LFOR:
; Clear the screen
call ClrScr

; Move the cursor to row 10, column 10
mov dh, 10
mov dl, 10
call Gotoxy...

By purchasing this solution you'll be able to access the following files:
Solution.pdf and prog.asm.

$15.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Assembly Language Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats