Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following partial function definition in C: char ctest(int a, int b) { char t1 = a_b; char t2 = () b_ O) a;

image text in transcribed

Consider the following partial function definition in C: char ctest(int a, int b) { char t1 = a_b; char t2 = () b_ O) a; return tl + 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 %1 # t2 addb %al, %cl # t2 += t1 movsbl %cl, %eax # Convert type 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: char Blank 3: - Blank 4: char

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

International Baccalaureate Computer Science HL And SL Option A Databases Part I Basic Concepts

Authors: H Sarah Shakibi PhD

1st Edition

1542457084, 978-1542457088

More Books

Students also viewed these Databases questions

Question

Discuss consumer-driven health plans.

Answered: 1 week ago