x86 Assembly Language Reference Manual

Conversion Instructions

Convert Byte to Word (cbtw)

cbtw
Operation

sign-extend AL -> AX

Description

cbtw converts the signed byte in AL to a signed word in AX by extending the most-significant bit (sign bit) of AL into all bits of AH.

Example
cbtw

Convert Word to Long (cwtl)

cwtl
Operation

sign-extend AX -> EAX

Description

cwtl converts the signed word in AX to a signed long in EAX by extending the most-significant bit (sign bit) of AX into two most-significant bytes of EAX.

Example
cwtl

Convert Signed Word to Signed Double Word (cwtd)

cwtd
Operation

sign-extend AX -> DX:AX

Description

cwtd converts the signed word in AX to a signed double word in DX:AX by extending the most-significant bit (sign bit) of AX into all bits of DX.

Example
cwtd

Convert Signed Long to Signed Double Long (cltd)

cltd
Operation

sign-extend EAX -> EDX:EAX

Description

cltd converts the signed long in EAX to a signed double long in EDX:EAX by extending the most-significant bit (sign bit) of EAX into all bits of EDX.

Example
cltd