Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Convert the c++ program into x86 assembly language. Comment the start of each code block that performs one of the listed mathematical calculations. Comments go

Convert the c++ program into x86 assembly language.

Comment the start of each "code block" that performs one of the listed mathematical calculations.

Comments go to the right of the actual code, all starting on the same column.

image text in transcribed

Convert the following C++ program into an 88 assembly language program.

Comment the start of each "code block" that performs one of the listed mathematical calculations

Comments go to the right of the actual code, all starting on the same column

Post ONLY your ASM file here to Blackboard when complete

// Global variables

short a = 5;

short b = 6;

short c = 7;

short d = 8;

short e;

short f;

short g;

short h;

//code

int main()

{

++d;

--c;

b= a+2;

a=d+9;

e=a+b-c-d;

f=-c;

g= f+e;

h=-b-c+a;

// Move a into the eax register

//Move b into the ebx register

//Move c into the ecx register

//Move d into the edx register

//Call the DumpRegs function

// Move e ince the eax register

// Move f into che ebx negister

// Move g into the ecx register

// Move h into the edx register

// Call the DumpRegs function

--h;

g = g+6;

f=16;

e = -g -f;

d = 5-e;

c = -c;

b= c + e - h;

a = -b + c -d;

// Move a into the eax register

//Move b into the ebx register

// Move c into the ecx register

// Move d into the edx register

// Call the DumpRegs function

// Move e into che eax register

/ Move f into the ebx register

// Move g into the ex register

//Move h into the edx register

// Call the DumpRegs function

// Call the WaitMsg function

}

fl. Hove a into the eax regiater 7. Move b ints the ebx reglater ff Hove o ints the ecx tegiater /1 Move d into the edx regiater (f Call the Dupregs funetion Yf Wove e into the eax. negister /1 Move of into the ebx zegiafer. C. Move g into che ecx zeqiatet H/ Move in into the edx zegiater 17 Ca11 the DungReqg fund 10 on h;g=g+6;f=16;e=gf;d=5e;c=ctb=c+ebia=b+c4t (1) Move a into the eax reqiater (f) Move b into the ebx fegiater (/ Move c into the ecx regiater (/ Move d into the edx regluter ff Ca11 the DurpRegs funation If Move e into the eax regiater (l) Move in into the ebx regipter (1) Move g into the eex register 1/ Wove h inco the edx fegiater (1) Cal1 the DumpRega tunction /f Cal1 the WaitMag function Afrach File

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

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions

Question

Have roles been defined and assigned?

Answered: 1 week ago