Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 4 3 pts Consider the following partial function definition in C: char ctest(int a, int b) { char t1 = a _ b; char

image text in transcribed

Question 4 3 pts Consider the following partial function definition in C: char ctest(int a, int b) { char t1 = a _ b; char t2 = () b_ O) a; return t1 + t2; The complete C code has been translated to this fragment of x86 assembly code (with comments): # %edi contains a, %esi contains b cmpl %esi, %edi # Compare a-b setge %al # t1 cmpl %edi, %esi Compare b-a setbe %cl addb %al, %cl # t2 += t1 movsbl %cl, %eax # Convert type # t2 Fill in the blanks below with exact C code (with no extra spaces) to complete the function definition above so that it matches the x86 code. Note that the blanks are ordered in the C code from top to bottom, left to right. Blank 1: Blank 2: Blank 3: Blank 4

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

Advances In Spatial And Temporal Databases 11th International Symposium Sstd 2009 Aalborg Denmark July 8 10 2009 Proceedings Lncs 5644

Authors: Nikos Mamoulis ,Thomas Seidl ,Kristian Torp ,Ira Assent

2009th Edition

3642029817, 978-3642029813

More Books

Students also viewed these Databases questions