RET instruction sizing The RET instruction opcode always generates a near return.
Automatic jump sizing Unless otherwise directed, the built-in assembler optimizes jump instructions by automatically selecting the shortest,
and therefore most efficient, form of a jump instruction. This automatic jump sizing applies to the unconditional jump
instruction (JMP), and to all conditional jump instructions when the target is a label (not a procedure or function).
For an unconditional jump instruction (JMP), the built-in assembler generates a short jump (one-byte opcode followed
by a one-byte displacement) if the distance to the target label is 128 to 127 bytes. Otherwise it generates a near
jump (one-byte opcode followed by a two-byte displacement).
For a conditional jump instruction, a short jump (one-byte opcode followed by a one-byte displacement) is generated
if the distance to the target label is 128 to 127 bytes. Otherwise, the built-in assembler generates a short jump with
the inverse condition, which jumps over a near jump to the target label (five bytes in total). For example, the assembly
statement
JC Stop
where Stop isn't within reach of a short jump, is converted to a machine code sequence that corresponds to this:
JNC Skip
JMP Stop
Skip:
Jumps to the entry points of procedures and functions are always near.