When pushing segment registers, as SS, CS, DS, ES, FS and GS, the stack pointer is incremented by four bytes, although the segment registers are only two bytes of size. According to the Intel manual, "The operand size (16, 32, or 64 bits) determines the amount by which the stack pointer is decremented (2, 4 or 8)."
Description
When pushing segment registers, as
SS
,CS
,DS
,ES
,FS
andGS
, the stack pointer is incremented by four bytes, although the segment registers are only two bytes of size. According to the Intel manual, "The operand size (16, 32, or 64 bits) determines the amount by which the stack pointer is decremented (2, 4 or 8)."Reference: Ref. Intel 64 and IA-32 Architecture Software Developer's Manual Vol. 2B 4-509
Affected instructions:
Reproduction guide
Instruction:
Input:
Observed output:
Expected output: Subtract only two bytes from
ESP
:System Info
OS:
PyVEX: