x64 Instructions

Most x86 instructions continue to be valid for x64 in 64-bit mode. Some rarely-used operations are no longer supported in 64-bit mode, such as:

  • binary-coded decimal arithmetic instructions: AAA, AAD, AAM, AAS, DAA, DAS

  • BOUND

  • PUSHAD and POPAD

  • most operations that dealt with segment registers, such as PUSH DS and POP DS. (Operations that use the FS or GS segment registers are still valid.)

The x64 instruction set includes recent additions to the x86, such as SSE 2. Programs compiled for x64 can freely use these instructions.

Data Transfer

The x64 provides new variants of the MOV instruction that can handle 64-bit immediate constants or memory addresses.

MOV

r,#n

r = #n

MOV

rax, m

Move contents at 64-bit address to rax.

MOV

m, rax

Move contents of rax to 64-bit address.

The x64 also provides a new instruction to sign-extend 32-bit operands to 64 bits.

MOVSXD

r1, r/m

Move DWORD with sign extension to QWORD.

Ordinary MOV operations into 32-bit subregisters automatically zero extend to 64 bits, so there is no MOVZXD instruction.

Two SSE instructions can be used to move 128-bit values (such as GUIDs) from memory to an xmmn register or vice versa.

MOVDQA

r1/m, r2/m

Move 128-bit aligned value to xmmn register, or vice versa.

MOVDQU

r1/m, r2/m

Move 128-bit value (not necessarily aligned) to register, or vice versa.

Data Conversion

CDQE

Convert dword (eax) to qword (rax).

CQO

convert qword (rax) to oword (rdx:rax).

String Manipulation

MOVSQ

Move qword from rsi to rdi.

CMPSQ

Compare qword at rsi with rdi.

SCASQ

Scan qword at rdi. Compares qword at rdi to rax.

LODSQ

Load qword from rsi into rax.

STOSQ

Store qword to rdi from rax.