A. Write a goto version in C that performs the same computation and mimics the control flow

Question:

When given the C code void cond(short a, short *p) { } if (a && *p < a) *p = a; GCC generates the following

A. Write a goto version in C that performs the same computation and mimics the control flow of the assembly code, in the style shown in Figure 3.16(b). You might find it helpful to first annotate the assembly code as we have done in our examples.

B. Explain why the assembly code contains two conditional branches, even though the C code has only one if statement.

Figure 3.16(b)

(b) Equivalent goto version 1 2 3 4 5 6 long gotodiff_se (long x, long y) { 7 8 9 10 11 12 13 } long result;

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: