7. Add the missing lines of assembly code to make the assembly code implement the c-code that is commented out. int attribute ((noinline)) takeThree (int a, int b, int c) ( int result; //result = a + b + c; asm volatile ( "mov 8A0, 8A1 \n\t "mov 8B0, 8B1 \n\t "add 8A0, 8A2 \n\t "adc 8B0, 8B2 \n\t //move low byte of a to //add the low bytes //add the high bytes //move low byte of a to low byte of result low byte of result ); : "d" (result) //output list : "d" (a), "d" (b), "d (c) //input list //clobber list return result;

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter12: Points, Classes, Virtual Functions And Abstract Classes
Section: Chapter Questions
Problem 19SA
icon
Related questions
Question

I need help with this please

7. Add the missing lines of assembly code to make the assembly code implement the c-code that is commented
out.
int attribute ((noinline)) takeThree (int a, int b, int c) (
int result;
//result = a + b + c;
asm volatile (
"mov 8A0, 8A1 \n\t
"mov 8B0, 8B1 \n\t
"add 8A0, 8A2 \n\t
"adc 8B0, 8B2 \n\t
//move low byte of a to
//add the low bytes
//add the high bytes
//move low byte of a to low byte of result
low byte of result
);
: "d" (result) //output list
: "d" (a), "d" (b), "d (c) //input list
//clobber list
return result;
Transcribed Image Text:7. Add the missing lines of assembly code to make the assembly code implement the c-code that is commented out. int attribute ((noinline)) takeThree (int a, int b, int c) ( int result; //result = a + b + c; asm volatile ( "mov 8A0, 8A1 \n\t "mov 8B0, 8B1 \n\t "add 8A0, 8A2 \n\t "adc 8B0, 8B2 \n\t //move low byte of a to //add the low bytes //add the high bytes //move low byte of a to low byte of result low byte of result ); : "d" (result) //output list : "d" (a), "d" (b), "d (c) //input list //clobber list return result;
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning