MOV

The MOV instruction class has four primary variants: movb, movw, movl, and movq. There also exist zero extension and sign extension variations in the forms of MOVS and MOVZ.

InstructionOperandsEffectDescription
mov[bwlq]S, DD SMove byte/word/double word/quad word
movabsqI, RR IMove quad word
movzb[wlq]S, RR ZE(S)Move zero-extended byte
movzw[lq]S, RR ZE(S)Move zero-extended word
movsb[wlq]S, RR SE(S)Move sign-extended byte
movsw[lq]S, RR SE(S)Move sign-extended word
movslqS, RR SE(S)Move sign-extended double word
cltq%rax SE(%eax)Sign-extend %eax to %rax

Notice there is no movzlq instruction. movl covers this functionality since, by convention, instructions moving double words into a 64-bit register automatically zeroes out the upper 32 bits.

PUSH and POP

InstructionOperandsEffectDescription
pushqSR[%rsp] R[%rsp] - 8
M[R[%rsp]] S
Push quad word
popqDD M[R[%rsp]]
R[%rsp] R[%rsp] + 8
Pop quad word

In x86 processors, the stack grows downward, with the “top” of the stack corresponding to lower addresses.

Bibliography

  • Bryant, Randal E., and David O’Hallaron. Computer Systems: A Programmer’s Perspective. Third edition, Global edition. Always Learning. Pearson, 2016.