X86-assembly/Instructions/cdq

From aldeid
Jump to navigation Jump to search
You are here:
cdq

Description

The CDQ (Convert Doubleword to Quadword) instruction extends the sign bit of EAX into the EDX register.

Syntax

cdq

Examples

mov   eax, 0x5   ; eax = 0x5, SF = 0
cdq              ; edx = 0x00000000
mov   eax, 0x5   ; eax = 0x5
neg   eax        ; eax = 0xFFFFFFFB, SF = 1
cdq              ; edx = 0xFFFFFFFF

Comments