Other signed operations

NEG

This operation does a two's complement.

Consider the following as an example: NEG EAX or NEG dword ptr [00403000].

If EAX were 01h, it becomes FFFFFFFFh (-1).

MOVSX

This moves a BYTE to WORD or WORD to DWORD, including the sign. It is a more flexible instruction than CBW, CWDE, CWD, since it accommodates operands.

Consider the following as an example: MOVSX EAX, BX.

If BX were FFFFh (-1) and the sign flag is set, EAX will be FFFFFFFFh (-1).

CBW

Similar to MOVSX, it converts a BYTE into WORD, including the sign. The affected register is AL and AX. This is an instruction without any operands and is similar to MOVSX.  The effect turns the byte AL extend to its word counterpart, AX.   Such conversion is dentoed with a "->" sign.  For example,  AL -> AX means we are extending the 8-bit number to a 16-bit without compromising the stored value.

If AL were FFh (-1), AX will be FFFFh (-1).

CWDE

This is similar to CBW, but converts a WORD into DWORD. It affects AX->EAX.

CWD

This is similar to CBW, but converts a WORD into DWORD. It affects AX-> DX:AX.

IMUL/IDIV

This performs MUL and DIV, but accepts operands from other registers or memory.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.229.253