وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

CWDE

CWDE

Usage:  CWDE         Modifies flags: None

Converts a signed word in AX to a signed doubleword in EAX by extending the sign bit of AX throughout EAX.

Sign Extensions


CBW                           ; o16 98               [8086]

CWDE                          ; o32 98               [386]


CWD                           ; o16 99               [8086]

CDQ                           ; o32 99               [386]


All these instructions sign-extend a short value into a longer one, by replicating the top bit of the original value to fill the extended one.


CBW extends AL into AX by repeating the top bit of AL in every bit of AH. CWDE extends AX into EAX. CWD extends AX into DX:AX by repeating the top bit of AX throughout DX, and CDQ extends EAX into EDX:EAX.


EXAMPLE:

mov eax 0

mov ax 00_1111_1111_1111_1111

cwde         ; eax = FFFF FFFFh