cqo

x86-64 and later

Convert Quadword to Octaword

cqo

Sign extends rax into rdx:rax, filling rdx with copies of the sign bit. idiv divides that 128 bit pair, so signed division is written as cqo then idiv; forgetting the cqo leaves whatever rdx happened to hold in the high half and the result is nonsense rather than an error.

Loading...

Forms

Every form of cqo the assembler accepts, from NASM's own instruction table. The second column is the processor that introduced the form; a badge marks a form that needs an extension, that is lockable, or that long mode dropped.

FormSinceNotes
cqo x86-64long