Shows a general comparison between arguments a and b, where data_t, the data type of the arguments,

Question:

The C code int comp (data_t a, data_t b) { return a COMP b; }

Shows a general comparison between arguments a and b, where data_t, the data type of the arguments, is defined (via typedef) to be one of the integer data types listed in Figure 3.1 and either signed or unsigned. The comparison COMP is defined via #define. 

Suppose a is in some portion of %rdx while b is in some portion of %rsi. For each of the following instruction sequences, determine which data types data_t and which comparisons COMP could cause the compiler to generate this code.

A. cmpl setl B. C. D. cmpw setge cmpb setbe cmpq setne %esi, %edi %al %si, %di %al %sil, %dil %al %rsi, %rdi

Figure 3.1

C declaration char short int long char * float double Intel data type Byte Word Double word Quad word Quad


Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Systems A Programmers Perspective

ISBN: 9781292101767

3rd Global Edition

Authors: Randal E. Bryant, David R. O'Hallaron

Question Posted: