5.1 General compare

    if (x r y) goto L1;

is a generalized conditional goto statement. x r y is the abstraction of x is r y. In an actual program, x is an expression, r is a comparison operator, and y is another expression.

For now, however, let us assume that x and y are simple variables or constants.

This conditional goto statement transforms to the following pseudo assembly instructions:

    cmp y,x 
    jr  L1

For example, let us assume the C code is as follows (y is unsigned):

    if (y <= 5) goto L1;

Then the matching assembly code is as follows:

    cmp $5,y 
    jna L1

Note that jna means “jump is not above”, which is the same as “jump if less-than-or-equal-to”.